aboutsummaryrefslogtreecommitdiff
path: root/toys/other/oneit.c
diff options
context:
space:
mode:
Diffstat (limited to 'toys/other/oneit.c')
-rw-r--r--toys/other/oneit.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/toys/other/oneit.c b/toys/other/oneit.c
index ff7aa914..8bb482da 100644
--- a/toys/other/oneit.c
+++ b/toys/other/oneit.c
@@ -24,15 +24,14 @@ config ONEIT
which point it reboots (or with -p, powers off) the system.
*/
+#define FOR_oneit
#include "toys.h"
#include <sys/reboot.h>
-DEFINE_GLOBALS(
+GLOBALS(
char *console;
)
-#define TT this.oneit
-
// The minimum amount of work necessary to get ctrl-c and such to work is:
//
// - Fork a child (PID 1 is special: can't exit, has various signals blocked).
@@ -59,7 +58,8 @@ void oneit_main(void)
// PID 1 can't call reboot() because it kills the task that calls it,
// which causes the kernel to panic before the actual reboot happens.
- if (!vfork()) reboot((toys.optflags&1) ? RB_POWER_OFF : RB_AUTOBOOT);
+ if (!vfork())
+ reboot((toys.optflags & FLAG_p) ? RB_POWER_OFF : RB_AUTOBOOT);
sleep(5);
_exit(1);
}