From 924f65030529d5a232c2be4ab6e2642dfdc2ea71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 10 Mar 2021 13:20:47 +0100 Subject: [PATCH] generators: warn but ignore failure to write timeouts 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 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/shared/generator.c b/src/shared/generator.c index 8b95c772db..41922d67d8 100644 --- a/src/shared/generator.c +++ b/src/shared/generator.c @@ -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) {