[tor-commits] [tor/master] fix monotime test mocking on 32-bit systems

nickm at torproject.org nickm at torproject.org
Thu Jul 21 12:05:50 UTC 2016


commit 852cff043b6f6561beb8021f3e8a05a327482d9a
Author: Nick Mathewson <nickm at torproject.org>
Date:   Thu Jul 21 14:05:29 2016 +0200

    fix monotime test mocking on 32-bit systems
---
 src/common/compat_time.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/common/compat_time.c b/src/common/compat_time.c
index 52abfeb..5891682 100644
--- a/src/common/compat_time.c
+++ b/src/common/compat_time.c
@@ -331,8 +331,8 @@ monotime_get(monotime_t *out)
 {
 #ifdef TOR_UNIT_TESTS
   if (monotime_mocking_enabled) {
-    out->ts_.tv_sec = mock_time_nsec / ONE_BILLION;
-    out->ts_.tv_nsec = mock_time_nsec % ONE_BILLION;
+    out->ts_.tv_sec = (time_t) (mock_time_nsec / ONE_BILLION);
+    out->ts_.tv_nsec = (int) (mock_time_nsec % ONE_BILLION);
     return;
   }
 #endif



More information about the tor-commits mailing list