summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/or/circuitbuild.c18
-rw-r--r--src/or/circuitbuild.h2
-rw-r--r--src/or/main.c2
3 files changed, 12 insertions, 10 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 0617c24776..7f4504f6b6 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -1138,22 +1138,24 @@ circuit_send_intermediate_onion_skin(origin_circuit_t *circ,
* something has also gone wrong with our network: notify the user, and
* abandon all not-yet-used circuits. */
void
-circuit_note_clock_jumped(int seconds_elapsed, bool was_idle)
+circuit_note_clock_jumped(int64_t seconds_elapsed, bool was_idle)
{
int severity = server_mode(get_options()) ? LOG_WARN : LOG_NOTICE;
if (was_idle) {
- tor_log(severity, LD_GENERAL, "Tor has been idle for %d seconds; "
- "assuming established circuits no longer work.",
- seconds_elapsed);
+ tor_log(severity, LD_GENERAL, "Tor has been idle for "I64_FORMAT
+ " seconds; assuming established circuits no longer work.",
+ I64_PRINTF_ARG(seconds_elapsed));
} else {
tor_log(severity, LD_GENERAL,
- "Your system clock just jumped %d seconds %s; "
+ "Your system clock just jumped "I64_FORMAT" seconds %s; "
"assuming established circuits no longer work.",
- seconds_elapsed >=0 ? seconds_elapsed : -seconds_elapsed,
+ I64_PRINTF_ARG(
+ seconds_elapsed >=0 ? seconds_elapsed : -seconds_elapsed),
seconds_elapsed >=0 ? "forward" : "backward");
}
- control_event_general_status(LOG_WARN, "CLOCK_JUMPED TIME=%d IDLE=%d",
- seconds_elapsed, was_idle?1:0);
+ control_event_general_status(LOG_WARN, "CLOCK_JUMPED TIME="I64_FORMAT
+ " IDLE=%d",
+ I64_PRINTF_ARG(seconds_elapsed), was_idle?1:0);
/* so we log when it works again */
note_that_we_maybe_cant_complete_circuits();
control_event_client_status(severity, "CIRCUIT_NOT_ESTABLISHED REASON=%s",
diff --git a/src/or/circuitbuild.h b/src/or/circuitbuild.h
index f3a8bbfc99..725d872d0b 100644
--- a/src/or/circuitbuild.h
+++ b/src/or/circuitbuild.h
@@ -29,7 +29,7 @@ void circuit_n_chan_done(channel_t *chan, int status,
int inform_testing_reachability(void);
int circuit_timeout_want_to_count_circ(const origin_circuit_t *circ);
int circuit_send_next_onion_skin(origin_circuit_t *circ);
-void circuit_note_clock_jumped(int seconds_elapsed, bool was_idle);
+void circuit_note_clock_jumped(int64_t seconds_elapsed, bool was_idle);
int circuit_extend(cell_t *cell, circuit_t *circ);
int circuit_init_cpath_crypto(crypt_path_t *cpath,
const char *key_data, size_t key_data_len,
diff --git a/src/or/main.c b/src/or/main.c
index b6035fa765..b8827b947d 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -2538,7 +2538,7 @@ update_current_time(time_t now)
monotime_coarse_diff_msec32(&last_updated,
&current_second_last_changed);
const int monotime_sec_passed = monotime_msec_passed / 1000;
- const int discrepency = monotime_sec_passed - seconds_elapsed;
+ const int discrepency = monotime_sec_passed - (int)seconds_elapsed;
/* If the monotonic clock deviates from time(NULL), we have a couple of
* possibilities. On some systems, this means we have been suspended or
* sleeping. Everywhere, it can mean that the wall-clock time has