From 48384dc2d841bac9ab1e1ef24addbccabed43c20 Mon Sep 17 00:00:00 2001 From: Elliot Ronaghan Date: Fri, 27 May 2016 16:20:23 -0700 Subject: Fix mixed decl in nstime.c Fix mixed decl in the gettimeofday() branch of nstime_update() --- src/nstime.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/nstime.c b/src/nstime.c index 26e49dc..aad2c26 100644 --- a/src/nstime.c +++ b/src/nstime.c @@ -128,9 +128,11 @@ nstime_update(nstime_t *time) time->ns = ts.tv_sec * BILLION + ts.tv_nsec; } #else - struct timeval tv; - gettimeofday(&tv, NULL); - time->ns = tv.tv_sec * BILLION + tv.tv_usec * 1000; + { + struct timeval tv; + gettimeofday(&tv, NULL); + time->ns = tv.tv_sec * BILLION + tv.tv_usec * 1000; + } #endif /* Handle non-monotonic clocks. */ -- cgit v0.12