|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
From 59cf3f439d358163d895093bb8adfbe1db650131 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
Date: Tue, 30 May 2017 23:14:31 -0400
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
Subject: [PATCH] systemctl: avoid spurious warning about missing reboot-param
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
file
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
$ reboot -f
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
Failed to read reboot parameter file: No such file or directory
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
It seems that the warning on ENOENT was inadvertently introduced in
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
27c06cb516c3b87c34f2a1c2c227152997d05c8c.
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
The warning reported in #5646 comes from systemctl, but let's fix the other
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
call site in the same way too.
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
Fixes #5646.
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
(cherry picked from commit 19fbf49cdec0e12fa0ee13d6ff6f858ea0f27479)
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
src/core/shutdown.c | 2 +-
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
src/systemctl/systemctl.c | 2 +-
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
2 files changed, 2 insertions(+), 2 deletions(-)
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
diff --git a/src/core/shutdown.c b/src/core/shutdown.c
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
index a2309b7726..a7d5e57936 100644
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
--- a/src/core/shutdown.c
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
+++ b/src/core/shutdown.c
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
@@ -403,7 +403,7 @@ int main(int argc, char *argv[]) {
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
_cleanup_free_ char *param = NULL;
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
r = read_one_line_file("/run/systemd/reboot-param", ¶m;;
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
- if (r < 0)
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
+ if (r < 0 && r != -ENOENT)
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
log_warning_errno(r, "Failed to read reboot parameter file: %m");
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
if (!isempty(param)) {
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
index cb9ca9ae1e..1a47cb564e 100644
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
--- a/src/systemctl/systemctl.c
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
+++ b/src/systemctl/systemctl.c
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
@@ -8260,7 +8260,7 @@ static int halt_now(enum action a) {
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
_cleanup_free_ char *param = NULL;
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
r = read_one_line_file("/run/systemd/reboot-param", ¶m;;
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
- if (r < 0)
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
+ if (r < 0 && r != -ENOENT)
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
log_warning_errno(r, "Failed to read reboot parameter file: %m");
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
if (!isempty(param)) {
|