From: Simon McVittie Date: Thu, 14 Jul 2011 17:45:13 +0000 (+0100) Subject: _dbus_get_current_time: move struct timeval into the non-monotonic branch X-Git-Tag: dbus-1.5.8~34 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e9508bf5af6fd5d618bbbb0e1a8c7791a26e3acc;p=thirdparty%2Fdbus.git _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 --- diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c index f9315702e..7a1eb27b3 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)