load-fragment: use config_parse_sec_fix_0() for TimeoutStopSec=

This commit is contained in:
Yu Watanabe
2018-05-31 11:09:41 +09:00
parent 71e270150f
commit 6c58305ac3
2 changed files with 6 additions and 7 deletions
+1 -1
View File
@@ -291,7 +291,7 @@ Service.ExecStopPost, config_parse_exec, SERVICE_EXE
Service.RestartSec, config_parse_sec, 0, offsetof(Service, restart_usec)
Service.TimeoutSec, config_parse_service_timeout, 0, 0
Service.TimeoutStartSec, config_parse_service_timeout, 0, 0
Service.TimeoutStopSec, config_parse_service_timeout, 0, 0
Service.TimeoutStopSec, config_parse_sec_fix_0, 0, offsetof(Service, timeout_stop_usec)
Service.RuntimeMaxSec, config_parse_sec, 0, offsetof(Service, runtime_max_usec)
Service.WatchdogSec, config_parse_sec, 0, offsetof(Service, watchdog_usec)
m4_dnl The following five only exist for compatibility, they moved into Unit, see above
+5 -6
View File
@@ -1944,7 +1944,7 @@ int config_parse_service_timeout(
assert(rvalue);
assert(s);
/* This is called for three cases: TimeoutSec=, TimeoutStopSec= and TimeoutStartSec=. */
/* This is called for two cases: TimeoutSec= and TimeoutStartSec=. */
r = parse_sec(rvalue, &usec);
if (r < 0) {
@@ -1958,12 +1958,11 @@ int config_parse_service_timeout(
if (usec <= 0)
usec = USEC_INFINITY;
if (!streq(lvalue, "TimeoutStopSec")) {
s->start_timeout_defined = true;
s->timeout_start_usec = usec;
}
if (!streq(lvalue, "TimeoutStartSec"))
s->start_timeout_defined = true;
s->timeout_start_usec = usec;
if (streq(lvalue, "TimeoutSec"))
s->timeout_stop_usec = usec;
return 0;