diff options
-rw-r--r-- | include/usage.h | 2 | ||||
-rw-r--r-- | init/halt.c | 15 |
2 files changed, 9 insertions, 8 deletions
diff --git a/include/usage.h b/include/usage.h index a09f7eac2..b901090b8 100644 --- a/include/usage.h +++ b/include/usage.h | |||
@@ -1424,7 +1424,7 @@ | |||
1424 | "-rw-rw-r-- 1 andersen andersen 554058 Apr 14 17:49 /tmp/busybox.tar.gz\n" | 1424 | "-rw-rw-r-- 1 andersen andersen 554058 Apr 14 17:49 /tmp/busybox.tar.gz\n" |
1425 | 1425 | ||
1426 | #define halt_trivial_usage \ | 1426 | #define halt_trivial_usage \ |
1427 | "[-d delay] [-n] [-f]" | 1427 | "[-d delay] [-n] [-f]" USE_FEATURE_WTMP(" [-w]") |
1428 | #define halt_full_usage "\n\n" \ | 1428 | #define halt_full_usage "\n\n" \ |
1429 | "Halt the system\n" \ | 1429 | "Halt the system\n" \ |
1430 | "\nOptions:" \ | 1430 | "\nOptions:" \ |
diff --git a/init/halt.c b/init/halt.c index 8c1f30b08..42b9edc08 100644 --- a/init/halt.c +++ b/init/halt.c | |||
@@ -20,16 +20,16 @@ int halt_main(int argc UNUSED_PARAM, char **argv) | |||
20 | { | 20 | { |
21 | static const int magic[] = { | 21 | static const int magic[] = { |
22 | #ifdef RB_HALT_SYSTEM | 22 | #ifdef RB_HALT_SYSTEM |
23 | RB_HALT_SYSTEM, | 23 | RB_HALT_SYSTEM, |
24 | #elif defined RB_HALT | 24 | #elif defined RB_HALT |
25 | RB_HALT, | 25 | RB_HALT, |
26 | #endif | 26 | #endif |
27 | #ifdef RB_POWER_OFF | 27 | #ifdef RB_POWER_OFF |
28 | RB_POWER_OFF, | 28 | RB_POWER_OFF, |
29 | #elif defined RB_POWERDOWN | 29 | #elif defined RB_POWERDOWN |
30 | RB_POWERDOWN, | 30 | RB_POWERDOWN, |
31 | #endif | 31 | #endif |
32 | RB_AUTOBOOT | 32 | RB_AUTOBOOT |
33 | }; | 33 | }; |
34 | static const smallint signals[] = { SIGUSR1, SIGUSR2, SIGTERM }; | 34 | static const smallint signals[] = { SIGUSR1, SIGUSR2, SIGTERM }; |
35 | 35 | ||
@@ -46,7 +46,7 @@ RB_AUTOBOOT | |||
46 | 46 | ||
47 | /* Parse and handle arguments */ | 47 | /* Parse and handle arguments */ |
48 | opt_complementary = "d+"; /* -d N */ | 48 | opt_complementary = "d+"; /* -d N */ |
49 | flags = getopt32(argv, "d:nfw", &delay); | 49 | flags = getopt32(argv, "d:nf" USE_FEATURE_WTMP("w"), &delay); |
50 | 50 | ||
51 | sleep(delay); | 51 | sleep(delay); |
52 | 52 | ||
@@ -63,10 +63,11 @@ RB_AUTOBOOT | |||
63 | if (uname(&uts) == 0) | 63 | if (uname(&uts) == 0) |
64 | safe_strncpy(utmp.ut_host, uts.release, sizeof(utmp.ut_host)); | 64 | safe_strncpy(utmp.ut_host, uts.release, sizeof(utmp.ut_host)); |
65 | updwtmp(bb_path_wtmp_file, &utmp); | 65 | updwtmp(bb_path_wtmp_file, &utmp); |
66 | #endif /* !ENABLE_FEATURE_WTMP */ | ||
67 | 66 | ||
68 | if (flags & 8) /* -w */ | 67 | if (flags & 8) /* -w */ |
69 | return EXIT_SUCCESS; | 68 | return EXIT_SUCCESS; |
69 | #endif /* !ENABLE_FEATURE_WTMP */ | ||
70 | |||
70 | if (!(flags & 2)) /* no -n */ | 71 | if (!(flags & 2)) /* no -n */ |
71 | sync(); | 72 | sync(); |
72 | 73 | ||