diff mbox series

[v4,07/18] selftests/nolibc: prefer <sys/reboot.h> to <linux/reboot.h>

Message ID 08f966f8e00b3537701bb10ef651f2ccf3e2d8b4.1688750763.git.falcon@tinylab.org
State Accepted
Commit 950add280c0b2221f2f28d0595c9c82f40cfe3ed
Headers show
Series selftests/nolibc: allow run with minimal kernel config | expand

Commit Message

Zhangjin Wu July 7, 2023, 6:30 p.m. UTC
Since both glibc and musl provide RB_ flags via <sys/reboot.h>, and we
just add RB_ flags for nolibc, let's use RB_ flags instead of
LINUX_REBOOT_ flags and only reserve the required <sys/reboot.h> header.

This allows compile libc-test for musl libc without the linux headers.

Signed-off-by: Zhangjin Wu <falcon@tinylab.org>
---
 tools/testing/selftests/nolibc/nolibc-test.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c
index fea1b06131f6..12ecae85403e 100644
--- a/tools/testing/selftests/nolibc/nolibc-test.c
+++ b/tools/testing/selftests/nolibc/nolibc-test.c
@@ -15,7 +15,6 @@ 
 #include <string.h>
 #ifndef _NOLIBC_STDIO_H
 /* standard libcs need more includes */
-#include <linux/reboot.h>
 #include <sys/io.h>
 #include <sys/ioctl.h>
 #include <sys/mman.h>
@@ -1180,7 +1179,7 @@  int main(int argc, char **argv, char **envp)
 		 */
 		printf("Leaving init with final status: %d\n", !!ret);
 		if (ret == 0)
-			reboot(LINUX_REBOOT_CMD_POWER_OFF);
+			reboot(RB_POWER_OFF);
 #if defined(__x86_64__)
 		/* QEMU started with "-device isa-debug-exit -no-reboot" will
 		 * exit with status code 2N+1 when N is written to 0x501. We