From: Yu Watanabe Date: Fri, 25 May 2018 03:17:52 +0000 (+0900) Subject: load-fragment: use parse_sec_fix_0() instead of updating the value later X-Git-Tag: v239~179^2~10 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fb27be3f60147685fe5272ce3fdb1384f92390b5;p=thirdparty%2Fsystemd.git load-fragment: use parse_sec_fix_0() instead of updating the value later --- diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c index a2cfefd7c43..11db63dd38e 100644 --- a/src/core/load-fragment.c +++ b/src/core/load-fragment.c @@ -1946,19 +1946,15 @@ int config_parse_service_timeout( /* This is called for two cases: TimeoutSec= and TimeoutStartSec=. */ - r = parse_sec(rvalue, &usec); + /* Traditionally, these options accepted 0 to disable the timeouts. However, a timeout of 0 suggests it happens + * immediately, hence fix this to become USEC_INFINITY instead. This is in-line with how we internally handle + * all other timeouts. */ + r = parse_sec_fix_0(rvalue, &usec); if (r < 0) { log_syntax(unit, LOG_ERR, filename, line, r, "Failed to parse %s= parameter, ignoring: %s", lvalue, rvalue); return 0; } - /* Traditionally, these options accepted 0 to disable the timeouts. However, a timeout of 0 suggests it happens - * immediately, hence fix this to become USEC_INFINITY instead. This is in-line with how we internally handle - * all other timeouts. */ - if (usec <= 0) - usec = USEC_INFINITY; - - s->start_timeout_defined = true; s->timeout_start_usec = usec;