chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
69039ad
)
time-util: use dual_timestamp_get()
author
Alexander Kuleshov
<kuleshovmail@gmail.com>
Thu, 4 Feb 2016 19:03:23 +0000
(
01:03
+0600)
committer
Sven Eden
<yamakuzure@gmx.net>
Wed, 17 May 2017 13:22:16 +0000
(15:22 +0200)
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
patch
|
blob
|
history
diff --git
a/src/basic/time-util.c
b/src/basic/time-util.c
index 34061fea9e51785eb974f2671cf6f73b3134956c..28b20f41805379dd6661974f62c3cfe141805d80 100644
(file)
--- a/
src/basic/time-util.c
+++ b/
src/basic/time-util.c
@@
-112,9
+112,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)