From e9508bf5af6fd5d618bbbb0e1a8c7791a26e3acc Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Thu, 14 Jul 2011 18:45:13 +0100 Subject: [PATCH] _dbus_get_current_time: move struct timeval into the non-monotonic branch It's only used there. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39231 Reviewed-by: Will Thompson --- dbus/dbus-sysdeps-unix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c index f931570..7a1eb27 100644 --- a/dbus/dbus-sysdeps-unix.c +++ b/dbus/dbus-sysdeps-unix.c @@ -2493,8 +2493,6 @@ void _dbus_get_current_time (long *tv_sec, long *tv_usec) { - struct timeval t; - #ifdef HAVE_MONOTONIC_CLOCK struct timespec ts; clock_gettime (CLOCK_MONOTONIC, &ts); @@ -2504,6 +2502,8 @@ _dbus_get_current_time (long *tv_sec, if (tv_usec) *tv_usec = ts.tv_nsec / 1000; #else + struct timeval t; + gettimeofday (&t, NULL); if (tv_sec) -- 2.7.4