diff options
Diffstat (limited to 'init')
-rw-r--r-- | init/init.c | 8 | ||||
-rw-r--r-- | init/reboot.c | 13 |
2 files changed, 4 insertions, 17 deletions
diff --git a/init/init.c b/init/init.c index 69ce4b2c9..1f0bd4aec 100644 --- a/init/init.c +++ b/init/init.c | |||
@@ -42,6 +42,7 @@ | |||
42 | #include <sys/mount.h> | 42 | #include <sys/mount.h> |
43 | #include <sys/types.h> | 43 | #include <sys/types.h> |
44 | #include <sys/wait.h> | 44 | #include <sys/wait.h> |
45 | #include <sys/reboot.h> | ||
45 | #include "busybox.h" | 46 | #include "busybox.h" |
46 | 47 | ||
47 | #include "init_shared.h" | 48 | #include "init_shared.h" |
@@ -50,9 +51,6 @@ | |||
50 | #ifdef CONFIG_SYSLOGD | 51 | #ifdef CONFIG_SYSLOGD |
51 | # include <sys/syslog.h> | 52 | # include <sys/syslog.h> |
52 | #endif | 53 | #endif |
53 | #if (__GNU_LIBRARY__ > 5) || defined(__dietlibc__) | ||
54 | #include <sys/reboot.h> | ||
55 | #endif | ||
56 | 54 | ||
57 | 55 | ||
58 | #if defined(__UCLIBC__) && !defined(__UCLIBC_HAS_MMU__) | 56 | #if defined(__UCLIBC__) && !defined(__UCLIBC_HAS_MMU__) |
@@ -665,11 +663,7 @@ static void init_reboot(unsigned long magic) | |||
665 | * linux/kernel/sys.c, which can cause the machine to panic when | 663 | * linux/kernel/sys.c, which can cause the machine to panic when |
666 | * the init process is killed.... */ | 664 | * the init process is killed.... */ |
667 | if ((pid = fork()) == 0) { | 665 | if ((pid = fork()) == 0) { |
668 | #if (__GNU_LIBRARY__ > 5) || defined(__dietlibc__) | ||
669 | reboot(magic); | 666 | reboot(magic); |
670 | #else | ||
671 | reboot(0xfee1dead, 672274793, magic); | ||
672 | #endif | ||
673 | _exit(0); | 667 | _exit(0); |
674 | } | 668 | } |
675 | waitpid (pid, NULL, 0); | 669 | waitpid (pid, NULL, 0); |
diff --git a/init/reboot.c b/init/reboot.c index e9f9ff831..5ca8b588a 100644 --- a/init/reboot.c +++ b/init/reboot.c | |||
@@ -25,18 +25,11 @@ | |||
25 | #include <stdlib.h> | 25 | #include <stdlib.h> |
26 | #include <unistd.h> | 26 | #include <unistd.h> |
27 | #include <getopt.h> | 27 | #include <getopt.h> |
28 | 28 | #include <sys/reboot.h> | |
29 | #include "busybox.h" | 29 | #include "busybox.h" |
30 | #include "init_shared.h" | 30 | #include "init_shared.h" |
31 | 31 | ||
32 | 32 | ||
33 | #if (__GNU_LIBRARY__ > 5) || defined(__dietlibc__) | ||
34 | #include <sys/reboot.h> | ||
35 | #define init_reboot(magic) reboot(magic) | ||
36 | #else | ||
37 | #define init_reboot(magic) reboot(0xfee1dead, 672274793, magic) | ||
38 | #endif | ||
39 | |||
40 | #ifndef RB_ENABLE_CAD | 33 | #ifndef RB_ENABLE_CAD |
41 | static const int RB_ENABLE_CAD = 0x89abcdef; | 34 | static const int RB_ENABLE_CAD = 0x89abcdef; |
42 | static const int RB_AUTOBOOT = 0x01234567; | 35 | static const int RB_AUTOBOOT = 0x01234567; |
@@ -57,7 +50,7 @@ extern int reboot_main(int argc, char **argv) | |||
57 | setpgrp(); | 50 | setpgrp(); |
58 | 51 | ||
59 | /* Allow Ctrl-Alt-Del to reboot system. */ | 52 | /* Allow Ctrl-Alt-Del to reboot system. */ |
60 | init_reboot(RB_ENABLE_CAD); | 53 | reboot(RB_ENABLE_CAD); |
61 | 54 | ||
62 | message(CONSOLE|LOG, "\n\rThe system is going down NOW !!\n"); | 55 | message(CONSOLE|LOG, "\n\rThe system is going down NOW !!\n"); |
63 | sync(); | 56 | sync(); |
@@ -74,7 +67,7 @@ extern int reboot_main(int argc, char **argv) | |||
74 | 67 | ||
75 | sync(); | 68 | sync(); |
76 | 69 | ||
77 | init_reboot(RB_AUTOBOOT); | 70 | reboot(RB_AUTOBOOT); |
78 | return 0; /* Shrug */ | 71 | return 0; /* Shrug */ |
79 | #else | 72 | #else |
80 | return kill_init(SIGTERM); | 73 | return kill_init(SIGTERM); |