svn commit: trunk/busybox: include init

aldot at busybox.net aldot at busybox.net
Mon Sep 1 15:24:52 UTC 2008


Author: aldot
Date: 2008-09-01 08:24:52 -0700 (Mon, 01 Sep 2008)
New Revision: 23293

Log:
- halt's -w depends on FEATURE_WTMP (Vladimir Dronnikov)


Modified:
   trunk/busybox/include/usage.h
   trunk/busybox/init/halt.c


Changeset:
Modified: trunk/busybox/include/usage.h
===================================================================
--- trunk/busybox/include/usage.h	2008-09-01 15:23:04 UTC (rev 23292)
+++ trunk/busybox/include/usage.h	2008-09-01 15:24:52 UTC (rev 23293)
@@ -1424,7 +1424,7 @@
        "-rw-rw-r--    1 andersen andersen   554058 Apr 14 17:49 /tmp/busybox.tar.gz\n"
 
 #define halt_trivial_usage \
-       "[-d delay] [-n] [-f]"
+       "[-d delay] [-n] [-f]" USE_FEATURE_WTMP(" [-w]")
 #define halt_full_usage "\n\n" \
        "Halt the system\n" \
      "\nOptions:" \

Modified: trunk/busybox/init/halt.c
===================================================================
--- trunk/busybox/init/halt.c	2008-09-01 15:23:04 UTC (rev 23292)
+++ trunk/busybox/init/halt.c	2008-09-01 15:24:52 UTC (rev 23293)
@@ -20,16 +20,16 @@
 {
 	static const int magic[] = {
 #ifdef RB_HALT_SYSTEM
-RB_HALT_SYSTEM,
+		RB_HALT_SYSTEM,
 #elif defined RB_HALT
-RB_HALT,
+		RB_HALT,
 #endif
 #ifdef RB_POWER_OFF
-RB_POWER_OFF,
+		RB_POWER_OFF,
 #elif defined RB_POWERDOWN
-RB_POWERDOWN,
+		RB_POWERDOWN,
 #endif
-RB_AUTOBOOT
+		RB_AUTOBOOT
 	};
 	static const smallint signals[] = { SIGUSR1, SIGUSR2, SIGTERM };
 
@@ -46,7 +46,7 @@
 
 	/* Parse and handle arguments */
 	opt_complementary = "d+"; /* -d N */
-	flags = getopt32(argv, "d:nfw", &delay);
+	flags = getopt32(argv, "d:nf" USE_FEATURE_WTMP("w"), &delay);
 
 	sleep(delay);
 
@@ -63,10 +63,11 @@
 	if (uname(&uts) == 0)
 		safe_strncpy(utmp.ut_host, uts.release, sizeof(utmp.ut_host));
 	updwtmp(bb_path_wtmp_file, &utmp);
-#endif /* !ENABLE_FEATURE_WTMP */
 
 	if (flags & 8) /* -w */
 		return EXIT_SUCCESS;
+#endif /* !ENABLE_FEATURE_WTMP */
+
 	if (!(flags & 2)) /* no -n */
 		sync();
 




More information about the busybox-cvs mailing list