*** empty log message ***

This commit is contained in:
Jorrit Herder 2006-03-13 10:33:50 +00:00
parent acdac1ec92
commit 0619cce2ab

View File

@ -27,6 +27,7 @@ void usage _ARGS(( void ));
int main _ARGS(( int argc, char *argv[] )); int main _ARGS(( int argc, char *argv[] ));
char *prog; char *prog;
char *reboot_code = "delay; boot";
void void
usage() usage()
@ -59,18 +60,10 @@ char **argv;
if (*opt == '-' && opt[1] == 0) break; /* -- */ if (*opt == '-' && opt[1] == 0) break; /* -- */
while (*opt != 0) switch (*opt++) { while (*opt != 0) switch (*opt++) {
case 'h': case 'h': flag = RBT_HALT; break;
flag = RBT_HALT; case 'r': flag = RBT_REBOOT; break;
break; case 'R': flag = RBT_RESET; break;
case 'r': case 'f': fast = 1; break;
flag = RBT_REBOOT;
break;
case 'R':
flag = RBT_RESET;
break;
case 'f':
fast = 1;
break;
case 'x': case 'x':
flag = RBT_MONITOR; flag = RBT_MONITOR;
if (*opt == 0) { if (*opt == 0) {
@ -92,6 +85,11 @@ char **argv;
exit(1); exit(1);
} }
if (flag == RBT_REBOOT) {
flag = RBT_MONITOR; /* set monitor code for reboot */
monitor_code = reboot_code;
}
if (stat("/usr/bin", &dummy) < 0) { if (stat("/usr/bin", &dummy) < 0) {
/* It seems that /usr isn't present, let's assume "-f." */ /* It seems that /usr isn't present, let's assume "-f." */
fast = 1; fast = 1;
@ -125,7 +123,7 @@ char **argv;
/* Give everybody a chance to die peacefully. */ /* Give everybody a chance to die peacefully. */
printf("Sending SIGTERM to all processes ...\n"); printf("Sending SIGTERM to all processes ...\n");
kill(-1, SIGTERM); kill(-1, SIGTERM);
sleep(2); sleep(1);
sync(); sync();