diff --git a/src/basic/raw-reboot.h b/src/basic/raw-reboot.h deleted file mode 100644 index d72ae1e955..0000000000 --- a/src/basic/raw-reboot.h +++ /dev/null @@ -1,15 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-or-later */ -#pragma once - -#include -#include -#include -#include - -/* glibc defines the reboot() API call, which is a wrapper around the system call of the same name, but without the - * extra "arg" parameter. Since we need that parameter for some calls, let's add a "raw" wrapper that is defined the - * same way, except it takes the additional argument. */ - -static inline int raw_reboot(int cmd, const void *arg) { - return (int) syscall(SYS_reboot, LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, cmd, arg); -} diff --git a/src/core/emergency-action.c b/src/core/emergency-action.c index 989bb1753e..439228c899 100644 --- a/src/core/emergency-action.c +++ b/src/core/emergency-action.c @@ -1,12 +1,10 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ -#include #include #include "ansi-color.h" #include "emergency-action.h" #include "manager.h" -#include "raw-reboot.h" #include "reboot-util.h" #include "special.h" #include "string-table.h" diff --git a/src/shared/reboot-util.c b/src/shared/reboot-util.c index f82c0654dc..948e15631d 100644 --- a/src/shared/reboot-util.c +++ b/src/shared/reboot-util.c @@ -1,10 +1,9 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ -#include #include #include #include -#include +#include #include #if HAVE_XENCTRL @@ -20,13 +19,16 @@ #include "fileio.h" #include "log.h" #include "proc-cmdline.h" -#include "raw-reboot.h" #include "reboot-util.h" #include "string-util.h" #include "umask-util.h" #include "utf8.h" #include "virt.h" +int raw_reboot(int cmd, const void *arg) { + return syscall(SYS_reboot, LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, cmd, arg); +} + bool reboot_parameter_is_valid(const char *parameter) { assert(parameter); diff --git a/src/shared/reboot-util.h b/src/shared/reboot-util.h index 55419dfb14..276361aea8 100644 --- a/src/shared/reboot-util.h +++ b/src/shared/reboot-util.h @@ -1,8 +1,16 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once +#include /* IWYU pragma: export */ +#include /* IWYU pragma: export */ + #include "forward.h" +/* glibc defines the reboot() API call, which is a wrapper around the system call of the same name, but + * without the extra "arg" parameter. Since we need that parameter for some calls, let's add a "raw" wrapper + * that is defined the same way, except it takes the additional argument. */ +int raw_reboot(int cmd, const void *arg); + bool reboot_parameter_is_valid(const char *parameter); int update_reboot_parameter_and_warn(const char *parameter, bool keep); diff --git a/src/shutdown/shutdown.c b/src/shutdown/shutdown.c index bb767161bd..3317068e47 100644 --- a/src/shutdown/shutdown.c +++ b/src/shutdown/shutdown.c @@ -4,11 +4,9 @@ ***/ #include -#include #include #include #include -#include #include #include diff --git a/src/systemctl/systemctl-util.c b/src/systemctl/systemctl-util.c index 019b763a86..faefc55619 100644 --- a/src/systemctl/systemctl-util.c +++ b/src/systemctl/systemctl-util.c @@ -1,7 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #include -#include #include #include "sd-bus.h"