]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
time-util: use dual_timestamp_get() 2540/head
authorAlexander Kuleshov <kuleshovmail@gmail.com>
Thu, 4 Feb 2016 19:03:23 +0000 (01:03 +0600)
committerAlexander Kuleshov <kuleshovmail@gmail.com>
Sat, 6 Feb 2016 12:26:05 +0000 (18:26 +0600)
The time-util.c provides dual_timestamp_get() function for getting
realtime and monotonic timestamps. Let's use it instead of direct
realtime/monotonic calculation.

src/basic/time-util.c

index bfc7cf870c7b0e69e56faddc6da28550c47d9b40..293442cf0e747523a9d9610555a48f372126b16d 100644 (file)
@@ -117,9 +117,8 @@ dual_timestamp* dual_timestamp_from_boottime_or_monotonic(dual_timestamp *ts, us
                 ts->realtime = ts->monotonic = USEC_INFINITY;
                 return ts;
         }
-        ts->realtime = now(CLOCK_REALTIME);
-        ts->monotonic = now(CLOCK_MONOTONIC);
 
+        dual_timestamp_get(ts);
         delta = (int64_t) now(clock_boottime_or_monotonic()) - (int64_t) u;
 
         if ((int64_t) ts->realtime > delta)