mirror of
https://github.com/systemd/systemd.git
synced 2024-11-27 12:13:33 +08:00
systemctl: avoid spurious warning about missing reboot-param file
$ reboot -f
Failed to read reboot parameter file: No such file or directory
It seems that the warning on ENOENT was inadvertently introduced in
27c06cb516
.
The warning reported in #5646 comes from systemctl, but let's fix the other
call site in the same way too.
Fixes #5646.
This commit is contained in:
parent
5e354b2252
commit
19fbf49cde
@ -403,7 +403,7 @@ int main(int argc, char *argv[]) {
|
||||
_cleanup_free_ char *param = NULL;
|
||||
|
||||
r = read_one_line_file("/run/systemd/reboot-param", ¶m);
|
||||
if (r < 0)
|
||||
if (r < 0 && r != -ENOENT)
|
||||
log_warning_errno(r, "Failed to read reboot parameter file: %m");
|
||||
|
||||
if (!isempty(param)) {
|
||||
|
@ -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", ¶m);
|
||||
if (r < 0)
|
||||
if (r < 0 && r != -ENOENT)
|
||||
log_warning_errno(r, "Failed to read reboot parameter file: %m");
|
||||
|
||||
if (!isempty(param)) {
|
||||
|
Loading…
Reference in New Issue
Block a user