diff options
author | Jeremie Koenig <jk@jk.fr.eu.org> | 2010-05-27 15:38:44 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-07-19 00:45:51 +0200 |
commit | 714674e4da3d92c5dd14e00ab30794a895b91eb4 (patch) | |
tree | 0d27bc73f1f2fe0175c5fc948451b86c52f9bb90 /init/halt.c | |
parent | f812eace1863feeac64dc8af27f4ab0f98119618 (diff) | |
download | busybox-w32-714674e4da3d92c5dd14e00ab30794a895b91eb4.tar.gz busybox-w32-714674e4da3d92c5dd14e00ab30794a895b91eb4.tar.bz2 busybox-w32-714674e4da3d92c5dd14e00ab30794a895b91eb4.zip |
init,halt: portability improvements
* make init and halt use the same RB_* constants for reboot()
* conditionalize the Linux-specific code
Inspired by init.init.diff from the Debian kFreeBSD patches at:
http://svn.debian.org/viewsvn/d-i/people/slackydeb/kfreebsd/busybox/1.14/debian
Signed-off-by: Jeremie Koenig <jk@jk.fr.eu.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'init/halt.c')
-rw-r--r-- | init/halt.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/init/halt.c b/init/halt.c index f1bb2c4a8..abd801fda 100644 --- a/init/halt.c +++ b/init/halt.c | |||
@@ -8,7 +8,7 @@ | |||
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include "libbb.h" | 10 | #include "libbb.h" |
11 | #include <sys/reboot.h> | 11 | #include "reboot.h" |
12 | 12 | ||
13 | #if ENABLE_FEATURE_WTMP | 13 | #if ENABLE_FEATURE_WTMP |
14 | #include <sys/utsname.h> | 14 | #include <sys/utsname.h> |
@@ -36,18 +36,6 @@ static void write_wtmp(void) | |||
36 | #define write_wtmp() ((void)0) | 36 | #define write_wtmp() ((void)0) |
37 | #endif | 37 | #endif |
38 | 38 | ||
39 | #ifndef RB_HALT_SYSTEM | ||
40 | #define RB_HALT_SYSTEM RB_HALT | ||
41 | #endif | ||
42 | |||
43 | #ifndef RB_POWERDOWN | ||
44 | /* Stop system and switch power off if possible. */ | ||
45 | # define RB_POWERDOWN 0x4321fedc | ||
46 | #endif | ||
47 | #ifndef RB_POWER_OFF | ||
48 | # define RB_POWER_OFF RB_POWERDOWN | ||
49 | #endif | ||
50 | |||
51 | 39 | ||
52 | int halt_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 40 | int halt_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
53 | int halt_main(int argc UNUSED_PARAM, char **argv) | 41 | int halt_main(int argc UNUSED_PARAM, char **argv) |