Skip to content

Commit 19fbf49

Browse files
committed
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 27c06cb. The warning reported in systemd#5646 comes from systemctl, but let's fix the other call site in the same way too. Fixes systemd#5646.
1 parent 5e354b2 commit 19fbf49

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/core/shutdown.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ int main(int argc, char *argv[]) {
403403
_cleanup_free_ char *param = NULL;
404404

405405
r = read_one_line_file("/run/systemd/reboot-param", &param);
406-
if (r < 0)
406+
if (r < 0 && r != -ENOENT)
407407
log_warning_errno(r, "Failed to read reboot parameter file: %m");
408408

409409
if (!isempty(param)) {

src/systemctl/systemctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8260,7 +8260,7 @@ static int halt_now(enum action a) {
82608260
_cleanup_free_ char *param = NULL;
82618261

82628262
r = read_one_line_file("/run/systemd/reboot-param", &param);
8263-
if (r < 0)
8263+
if (r < 0 && r != -ENOENT)
82648264
log_warning_errno(r, "Failed to read reboot parameter file: %m");
82658265

82668266
if (!isempty(param)) {

0 commit comments

Comments
 (0)