From: Jorrit Herder Date: Mon, 13 Mar 2006 10:33:50 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: v3.1.2a~253 X-Git-Url: http://zhaoyanbai.com/repos/icons/debian/static/expat.png?a=commitdiff_plain;h=0619cce2ab84a94fb4fc7784f2900972fc92be6a;p=minix.git *** empty log message *** --- diff --git a/commands/reboot/halt.c b/commands/reboot/halt.c index 38d36a9ee..456b5234c 100755 --- a/commands/reboot/halt.c +++ b/commands/reboot/halt.c @@ -27,6 +27,7 @@ void usage _ARGS(( void )); int main _ARGS(( int argc, char *argv[] )); char *prog; +char *reboot_code = "delay; boot"; void usage() @@ -59,18 +60,10 @@ char **argv; if (*opt == '-' && opt[1] == 0) break; /* -- */ while (*opt != 0) switch (*opt++) { - case 'h': - flag = RBT_HALT; - break; - case 'r': - flag = RBT_REBOOT; - break; - case 'R': - flag = RBT_RESET; - break; - case 'f': - fast = 1; - break; + case 'h': flag = RBT_HALT; break; + case 'r': flag = RBT_REBOOT; break; + case 'R': flag = RBT_RESET; break; + case 'f': fast = 1; break; case 'x': flag = RBT_MONITOR; if (*opt == 0) { @@ -92,6 +85,11 @@ char **argv; exit(1); } + if (flag == RBT_REBOOT) { + flag = RBT_MONITOR; /* set monitor code for reboot */ + monitor_code = reboot_code; + } + if (stat("/usr/bin", &dummy) < 0) { /* It seems that /usr isn't present, let's assume "-f." */ fast = 1; @@ -125,7 +123,7 @@ char **argv; /* Give everybody a chance to die peacefully. */ printf("Sending SIGTERM to all processes ...\n"); kill(-1, SIGTERM); - sleep(2); + sleep(1); sync();