diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-07-04 19:10:11 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-07-04 19:12:47 +0200 |
commit | 1f65fd4926c5b88db770c1b47a0b0a24c2319d12 (patch) | |
tree | 3ff3c0268a5d02aa96fcde241816fcb2bf7b6e02 /src/systemctl | |
parent | 7810d22171bbff1301397357afd4146016a60bde (diff) | |
download | systemd-1f65fd4926c5b88db770c1b47a0b0a24c2319d12.tar.gz |
basic/time-util: add helper function to check if timestamp is set
No functional change.
Diffstat (limited to 'src/systemctl')
-rw-r--r-- | src/systemctl/systemctl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index dbe442d7da..8eb9498c19 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -1228,7 +1228,7 @@ static usec_t calc_next_elapse(dual_timestamp *nw, dual_timestamp *next) { assert(nw); assert(next); - if (next->monotonic != USEC_INFINITY && next->monotonic > 0) { + if (timestamp_is_set(next->monotonic)) { usec_t converted; if (next->monotonic > nw->monotonic) @@ -1236,7 +1236,7 @@ static usec_t calc_next_elapse(dual_timestamp *nw, dual_timestamp *next) { else converted = nw->realtime - (nw->monotonic - next->monotonic); - if (next->realtime != USEC_INFINITY && next->realtime > 0) + if (timestamp_is_set(next->realtime)) next_elapse = MIN(converted, next->realtime); else next_elapse = converted; |