guest/init: update reboot() call

The reboot() call that guest/init used was an older version, the
manpage talks about libc4 and libc5.
Update it to the current version exported by glibc by using the right
include file and adjusting the parameter.
This also fixed GCC 5.1.0 compile, because linux/reboot.h misses the
actual prototype.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
This commit is contained in:
Andre Przywara
2015-06-12 16:02:52 +01:00
committed by Will Deacon
parent 9ed717c350
commit 372f583d35
+2 -2
View File
@@ -9,7 +9,7 @@
#include <errno.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <linux/reboot.h>
#include <sys/reboot.h>
static int run_process(char *filename)
{
@@ -70,7 +70,7 @@ int main(int argc, char *argv[])
} while (corpse != child);
}
reboot(LINUX_REBOOT_CMD_RESTART);
reboot(RB_AUTOBOOT);
printf("Init failed: %s\n", strerror(errno));