From: Yu Watanabe Date: Fri, 25 May 2018 03:16:24 +0000 (+0900) Subject: load-fragment: use config_parse_sec_fix_0() for TimeoutStopSec= X-Git-Tag: v239~179^2~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c58305ac34d893e469968a54250872dece56457;p=thirdparty%2Fsystemd.git load-fragment: use config_parse_sec_fix_0() for TimeoutStopSec= --- diff --git a/src/core/load-fragment-gperf.gperf.m4 b/src/core/load-fragment-gperf.gperf.m4 index 3757a651b21..e676811874a 100644 --- a/src/core/load-fragment-gperf.gperf.m4 +++ b/src/core/load-fragment-gperf.gperf.m4 @@ -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 diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c index 449dfc1f5fb..a2cfefd7c43 100644 --- a/src/core/load-fragment.c +++ b/src/core/load-fragment.c @@ -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;