From c0e56edaf256adb6c60c5a052525a1ffbb927901 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Mon, 8 Oct 2012 00:02:30 -0500 Subject: New build infrastructure to generate FLAG_ macros and TT alias, #define FOR_commandname before #including toys.h to trigger it. Rename DEFINE_GLOBALS() to just GLOBALS() (because I could never remember if it was DECLARE_GLOBALS). Convert existing commands to use new infrastructure, and replace optflag constants with FLAG_ macros where appropriate. --- toys/other/oneit.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'toys/other/oneit.c') 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 -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); } -- cgit v1.2.3