diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-02-21 17:42:59 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-02-22 10:42:06 +0100 |
commit | c52a937b460f8f32d6bb55a405faf247822b70a7 (patch) | |
tree | 2d9a7a570424fe30b938726ed878a534ce122291 /src/core/emergency-action.c | |
parent | d06f3829cdfcf1798419a9efded245fd1202f0db (diff) | |
download | systemd-c52a937b460f8f32d6bb55a405faf247822b70a7.tar.gz |
basic: add a common syscall wrapper around reboot()
This mimics the raw_clone() call we have in place already and
establishes a new syscall wrapper raw_reboot() that wraps the kernel's
reboot() system call in a bit more low-level fashion that glibc's
reboot() wrapper. The main difference is that the extra "arg" argument
is supported.
Ultimately this just replaces the syscall wrapper implementation we
currently have at three places in our codebase by a single one.
With this change this means that all our syscall() invocations are
neatly separated out in static inline system call wrappers in our header
functions.
Diffstat (limited to 'src/core/emergency-action.c')
-rw-r--r-- | src/core/emergency-action.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/emergency-action.c b/src/core/emergency-action.c index decfacd600..095033732b 100644 --- a/src/core/emergency-action.c +++ b/src/core/emergency-action.c @@ -20,11 +20,11 @@ ***/ #include <sys/reboot.h> -#include <linux/reboot.h> #include "bus-error.h" #include "bus-util.h" #include "emergency-action.h" +#include "raw-reboot.h" #include "special.h" #include "string-table.h" #include "terminal-util.h" @@ -88,7 +88,7 @@ int emergency_action( if (!isempty(reboot_arg)) { log_info("Rebooting with argument '%s'.", reboot_arg); - syscall(SYS_reboot, LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, LINUX_REBOOT_CMD_RESTART2, reboot_arg); + (void) raw_reboot(LINUX_REBOOT_CMD_RESTART2, reboot_arg); log_warning_errno(errno, "Failed to reboot with parameter, retrying without: %m"); } |