diff --git a/src/tool_util.c b/src/tool_util.c index 3ca13e7cbf..de98b82823 100644 --- a/src/tool_util.c +++ b/src/tool_util.c @@ -74,7 +74,7 @@ struct timeval tvnow(void) struct timespec tsnow; if(0 == clock_gettime(CLOCK_MONOTONIC, &tsnow)) { now.tv_sec = tsnow.tv_sec; - now.tv_usec = tsnow.tv_nsec / 1000; + now.tv_usec = (int)(tsnow.tv_nsec / 1000); } /* ** Even when the configure process has truly detected monotonic clock diff --git a/tests/libtest/testutil.c b/tests/libtest/testutil.c index 94a0b46be4..d40603d91c 100644 --- a/tests/libtest/testutil.c +++ b/tests/libtest/testutil.c @@ -55,7 +55,7 @@ struct timeval tutil_tvnow(void) struct timespec tsnow; if(0 == clock_gettime(CLOCK_MONOTONIC, &tsnow)) { now.tv_sec = tsnow.tv_sec; - now.tv_usec = tsnow.tv_nsec / 1000; + now.tv_usec = (int)(tsnow.tv_nsec / 1000); } /* ** Even when the configure process has truly detected monotonic clock diff --git a/tests/server/util.c b/tests/server/util.c index 577a56cb2a..8e76f0c9be 100644 --- a/tests/server/util.c +++ b/tests/server/util.c @@ -475,7 +475,7 @@ static struct timeval tvnow(void) struct timespec tsnow; if(0 == clock_gettime(CLOCK_MONOTONIC, &tsnow)) { now.tv_sec = tsnow.tv_sec; - now.tv_usec = tsnow.tv_nsec / 1000; + now.tv_usec = (int)(tsnow.tv_nsec / 1000); } /* ** Even when the configure process has truly detected monotonic clock