]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Avoid a compilation warning on macOS in scheduler_ev_add()
authorteor <teor2345@gmail.com>
Tue, 19 Sep 2017 06:32:47 +0000 (16:32 +1000)
committerteor <teor2345@gmail.com>
Tue, 19 Sep 2017 06:32:47 +0000 (16:32 +1000)
This warning is caused by a different tv_usec data type on macOS
compared to the system on which the patch was developed.

Fixes 23575 on 0.3.2.1-alpha.

changes/bug23575 [new file with mode: 0644]
src/or/scheduler.c

diff --git a/changes/bug23575 b/changes/bug23575
new file mode 100644 (file)
index 0000000..2e63e6d
--- /dev/null
@@ -0,0 +1,4 @@
+  o Minor bugfixes (scheduler):
+    - Avoid a compilation warning on macOS in scheduler_ev_add() caused by
+      a different tv_usec data type.
+      Fixes 23575 on 0.3.2.1-alpha.
index 43fff2bf2b44a34605e531beaacf9e42f6ab445b..ca3cafd9af7cf17a823421ff143e2568d384e539 100644 (file)
@@ -508,7 +508,7 @@ scheduler_ev_add(const struct timeval *next_run)
   tor_assert(next_run);
   if (BUG(event_add(run_sched_ev, next_run) < 0)) {
     log_warn(LD_SCHED, "Adding to libevent failed. Next run time was set to: "
-                       "%ld.%06ld", next_run->tv_sec, next_run->tv_usec);
+                       "%ld.%06ld", next_run->tv_sec, (long)next_run->tv_usec);
     return;
   }
 }