Commit 950add28 authored by Zhangjin Wu's avatar Zhangjin Wu Committed by Willy Tarreau
Browse files

selftests/nolibc: prefer <sys/reboot.h> to <linux/reboot.h>



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: default avatarZhangjin Wu <falcon@tinylab.org>
Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
parent 788aca91
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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>
@@ -1181,7 +1180,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