[tor-commits] [tor/master] Once more, 32-bit fixes on monotime mocking

nickm at torproject.org nickm at torproject.org
Thu Jul 21 12:32:17 UTC 2016


commit 1d0775684d3faa0826f7a51f17f6e3442777e313
Author: Nick Mathewson <nickm at torproject.org>
Date:   Thu Jul 21 14:32:15 2016 +0200

    Once more, 32-bit fixes on monotime mocking
---
 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 011bc9e..cc2c3c8 100644
--- a/src/common/compat_time.c
+++ b/src/common/compat_time.c
@@ -347,8 +347,8 @@ monotime_coarse_get(monotime_coarse_t *out)
 {
 #ifdef TOR_UNIT_TESTS
   if (monotime_mocking_enabled) {
-    out->ts_.tv_sec = mock_time_nsec_coarse / ONE_BILLION;
-    out->ts_.tv_nsec = mock_time_nsec_coarse % ONE_BILLION;
+    out->ts_.tv_sec = (time_t) (mock_time_nsec_coarse / ONE_BILLION);
+    out->ts_.tv_nsec = (int) (mock_time_nsec_coarse % ONE_BILLION);
     return;
   }
 #endif



More information about the tor-commits mailing list