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/run | |
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/run')
-rw-r--r-- | src/run/run.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/run/run.c b/src/run/run.c index 05c1552a8b..c11b7f57ff 100644 --- a/src/run/run.c +++ b/src/run/run.c @@ -1266,8 +1266,8 @@ static int start_transient_service( else if (c.exit_code > 0) log_info("Main processes terminated with: code=%s/status=%s", sigchld_code_to_string(c.exit_code), signal_to_string(c.exit_status)); - if (c.inactive_enter_usec > 0 && c.inactive_enter_usec != USEC_INFINITY && - c.inactive_exit_usec > 0 && c.inactive_exit_usec != USEC_INFINITY && + if (timestamp_is_set(c.inactive_enter_usec) && + timestamp_is_set(c.inactive_exit_usec) && c.inactive_enter_usec > c.inactive_exit_usec) { char ts[FORMAT_TIMESPAN_MAX]; log_info("Service runtime: %s", format_timespan(ts, sizeof(ts), c.inactive_enter_usec - c.inactive_exit_usec, USEC_PER_MSEC)); |