]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
systemctl: avoid spurious warning about missing reboot-param file 6060/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 31 May 2017 03:14:31 +0000 (23:14 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 31 May 2017 03:41:31 +0000 (23:41 -0400)
$ reboot -f
Failed to read reboot parameter file: No such file or directory

It seems that the warning on ENOENT was inadvertently introduced in
27c06cb516c3b87c34f2a1c2c227152997d05c8c.

The warning reported in #5646 comes from systemctl, but let's fix the other
call site in the same way too.

Fixes #5646.

src/core/shutdown.c
src/systemctl/systemctl.c

index a2309b77264130e621c6a482de8372173e3268cd..a7d5e57936d18336f258733d01f2ece7e06ef72b 100644 (file)
@@ -403,7 +403,7 @@ int main(int argc, char *argv[]) {
                         _cleanup_free_ char *param = NULL;
 
                         r = read_one_line_file("/run/systemd/reboot-param", &param);
-                        if (r < 0)
+                        if (r < 0 && r != -ENOENT)
                                 log_warning_errno(r, "Failed to read reboot parameter file: %m");
 
                         if (!isempty(param)) {
index 8b42a93ba318e87c2334cab4d086cdf5afa126d6..2f69e863c5e8ae0dee8935b0f4e47f47da6aaf97 100644 (file)
@@ -8260,7 +8260,7 @@ static int halt_now(enum action a) {
                 _cleanup_free_ char *param = NULL;
 
                 r = read_one_line_file("/run/systemd/reboot-param", &param);
-                if (r < 0)
+                if (r < 0 && r != -ENOENT)
                         log_warning_errno(r, "Failed to read reboot parameter file: %m");
 
                 if (!isempty(param)) {