mirror of
https://github.com/sheumann/hush.git
synced 2024-12-27 16:31:24 +00:00
- halt's -w depends on FEATURE_WTMP (Vladimir Dronnikov)
This commit is contained in:
parent
d129d7c3cd
commit
d93179fd5b
@ -1424,7 +1424,7 @@
|
|||||||
"-rw-rw-r-- 1 andersen andersen 554058 Apr 14 17:49 /tmp/busybox.tar.gz\n"
|
"-rw-rw-r-- 1 andersen andersen 554058 Apr 14 17:49 /tmp/busybox.tar.gz\n"
|
||||||
|
|
||||||
#define halt_trivial_usage \
|
#define halt_trivial_usage \
|
||||||
"[-d delay] [-n] [-f]"
|
"[-d delay] [-n] [-f]" USE_FEATURE_WTMP(" [-w]")
|
||||||
#define halt_full_usage "\n\n" \
|
#define halt_full_usage "\n\n" \
|
||||||
"Halt the system\n" \
|
"Halt the system\n" \
|
||||||
"\nOptions:" \
|
"\nOptions:" \
|
||||||
|
@ -46,7 +46,7 @@ RB_AUTOBOOT
|
|||||||
|
|
||||||
/* Parse and handle arguments */
|
/* Parse and handle arguments */
|
||||||
opt_complementary = "d+"; /* -d N */
|
opt_complementary = "d+"; /* -d N */
|
||||||
flags = getopt32(argv, "d:nfw", &delay);
|
flags = getopt32(argv, "d:nf" USE_FEATURE_WTMP("w"), &delay);
|
||||||
|
|
||||||
sleep(delay);
|
sleep(delay);
|
||||||
|
|
||||||
@ -63,10 +63,11 @@ RB_AUTOBOOT
|
|||||||
if (uname(&uts) == 0)
|
if (uname(&uts) == 0)
|
||||||
safe_strncpy(utmp.ut_host, uts.release, sizeof(utmp.ut_host));
|
safe_strncpy(utmp.ut_host, uts.release, sizeof(utmp.ut_host));
|
||||||
updwtmp(bb_path_wtmp_file, &utmp);
|
updwtmp(bb_path_wtmp_file, &utmp);
|
||||||
#endif /* !ENABLE_FEATURE_WTMP */
|
|
||||||
|
|
||||||
if (flags & 8) /* -w */
|
if (flags & 8) /* -w */
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
|
#endif /* !ENABLE_FEATURE_WTMP */
|
||||||
|
|
||||||
if (!(flags & 2)) /* no -n */
|
if (!(flags & 2)) /* no -n */
|
||||||
sync();
|
sync();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user