diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-04-14 13:47:13 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-04-14 13:47:13 +0200 |
commit | dcab85be18ff2e9f5aa164801b17c37cd650a660 (patch) | |
tree | e118fbc4fee35227f55397c527f7d22dc12399ef /src/core/service.c | |
parent | core: add assertion in two inline functions (diff) | |
download | systemd-dcab85be18ff2e9f5aa164801b17c37cd650a660.tar.xz systemd-dcab85be18ff2e9f5aa164801b17c37cd650a660.zip |
core: do not show TimeoutStopSec= in dump message if it is not set
Diffstat (limited to 'src/core/service.c')
-rw-r--r-- | src/core/service.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/core/service.c b/src/core/service.c index 0efd861888..c4d8378557 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -861,16 +861,19 @@ static void service_dump(Unit *u, FILE *f, const char *prefix) { fprintf(f, "%sRestartSec: %s\n" "%sTimeoutStartSec: %s\n" - "%sTimeoutStopSec: %s\n" - "%sTimeoutAbortSec: %s\n" - "%sRuntimeMaxSec: %s\n" - "%sWatchdogSec: %s\n", + "%sTimeoutStopSec: %s\n", prefix, format_timespan(buf_restart, sizeof(buf_restart), s->restart_usec, USEC_PER_SEC), prefix, format_timespan(buf_start, sizeof(buf_start), s->timeout_start_usec, USEC_PER_SEC), - prefix, format_timespan(buf_stop, sizeof(buf_stop), s->timeout_stop_usec, USEC_PER_SEC), - prefix, s->timeout_abort_set - ? format_timespan(buf_abort, sizeof(buf_abort), s->timeout_abort_usec, USEC_PER_SEC) - : "", + prefix, format_timespan(buf_stop, sizeof(buf_stop), s->timeout_stop_usec, USEC_PER_SEC)); + + if (s->timeout_abort_set) + fprintf(f, + "%sTimeoutAbortSec: %s\n", + prefix, format_timespan(buf_abort, sizeof(buf_abort), s->timeout_abort_usec, USEC_PER_SEC)); + + fprintf(f, + "%sRuntimeMaxSec: %s\n" + "%sWatchdogSec: %s\n", prefix, format_timespan(buf_runtime, sizeof(buf_runtime), s->runtime_max_usec, USEC_PER_SEC), prefix, format_timespan(buf_watchdog, sizeof(buf_watchdog), s->watchdog_usec, USEC_PER_SEC)); |