summaryrefslogtreecommitdiff
path: root/src/shared/generator.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-07-03 08:29:32 -0400
committerLennart Poettering <lennart@poettering.net>2017-07-03 14:29:32 +0200
commit0004f698df1410ef8b6ab3fb5f4b41a60c91182c (patch)
tree602a66a4117fe4563c9a489aed4488c6b20000c8 /src/shared/generator.c
parent131d5e148e9ed883b3c5a3de7aca9a4f97b2774e (diff)
downloadsystemd-0004f698df1410ef8b6ab3fb5f4b41a60c91182c.tar.gz
Parse "timeout=0" as infinity in various generators (#6264)
This extends 2d79a0bbb9f651656384a0a86ed814e6306fb5dd to the kernel command line parsing. The parsing is changed a bit to only understand "0" as infinity. If units are specified, parse normally, e.g. "0s" is just 0. This makes it possible to provide a zero timeout if necessary. Simple test is added. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1462378.
Diffstat (limited to 'src/shared/generator.c')
-rw-r--r--src/shared/generator.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/shared/generator.c b/src/shared/generator.c
index 19ec133772..6a78ebbda7 100644
--- a/src/shared/generator.c
+++ b/src/shared/generator.c
@@ -167,12 +167,13 @@ int generator_write_timeouts(
usec_t u;
int r;
- r = fstab_filter_options(opts, "comment=systemd.device-timeout\0" "x-systemd.device-timeout\0",
+ r = fstab_filter_options(opts, "comment=systemd.device-timeout\0"
+ "x-systemd.device-timeout\0",
NULL, &timeout, filtered);
if (r <= 0)
return r;
- r = parse_sec(timeout, &u);
+ r = parse_sec_fix_0(timeout, &u);
if (r < 0) {
log_warning("Failed to parse timeout for %s, ignoring: %s", where, timeout);
return 0;