]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
generators: warn but ignore failure to write timeouts
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 10 Mar 2021 12:20:47 +0000 (13:20 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 11 Mar 2021 08:19:00 +0000 (09:19 +0100)
When we failed to split the options (because of disallowed quoting syntax, which
might be a bug in its own), we would silently fail. Instead, let's emit a warning.
Since we ignore the value if we cannot parse it anyway, let's ignore this error
too.

src/shared/generator.c

index 8b95c772db184b75cac7df3ef74f9d603276eda9..41922d67d8c989d07a21b563b0c44cb41ee65e75 100644 (file)
@@ -216,8 +216,12 @@ int generator_write_timeouts(
         r = fstab_filter_options(opts, "comment=systemd.device-timeout\0"
                                        "x-systemd.device-timeout\0",
                                  NULL, &timeout, filtered);
-        if (r <= 0)
-                return r;
+        if (r < 0) {
+                log_warning_errno(r, "Failed to parse fstab options, ignoring: %m");
+                return 0;
+        }
+        if (r == 0)
+                return 0;
 
         r = parse_sec_fix_0(timeout, &u);
         if (r < 0) {