summaryrefslogtreecommitdiffstats
path: root/login-utils
diff options
context:
space:
mode:
authorMarek Polacek2010-12-10 15:52:44 +0100
committerKarel Zak2010-12-10 15:52:44 +0100
commit84228d125ec569c31bbe9092245c37439aef4aab (patch)
tree91d5c146d84717ce0770d8cfd48084d81176f999 /login-utils
parentshutdown: Use EXIT_* (diff)
downloadkernel-qcow2-util-linux-84228d125ec569c31bbe9092245c37439aef4aab.tar.gz
kernel-qcow2-util-linux-84228d125ec569c31bbe9092245c37439aef4aab.tar.xz
kernel-qcow2-util-linux-84228d125ec569c31bbe9092245c37439aef4aab.zip
simpleinit: Use EXIT_*
[kzak@redhat.com: use the main() part of the patch] Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'login-utils')
-rw-r--r--login-utils/simpleinit.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/login-utils/simpleinit.c b/login-utils/simpleinit.c
index 9277a3cc4..d1f62641a 100644
--- a/login-utils/simpleinit.c
+++ b/login-utils/simpleinit.c
@@ -241,7 +241,7 @@ int main(int argc, char *argv[])
printf("tty= %s\n", inittab[i].tty);
printf("termcap= %s\n", inittab[i].termcap);
}
- exit(0);
+ exit(EXIT_SUCCESS);
#endif
signal (SIGHUP, sighup_handler); /* Better semantics with signal(2) */
@@ -257,7 +257,7 @@ int main(int argc, char *argv[])
case 0: /* Child */
execl (final_prog, final_prog, "start", NULL);
err ( _("error running finalprog\n") );
- _exit (1);
+ _exit (EXIT_FAILURE);
break;
case -1: /* Error */
err ( _("error forking finalprog\n") );
@@ -539,7 +539,7 @@ static void spawn (int i)
execve(inittab[i].toks[0], inittab[i].toks, env);
err(_("exec failed\n"));
sleep(5);
- _exit(1);
+ _exit(EXIT_FAILURE);
}
}
@@ -699,7 +699,7 @@ static void sigint_handler (int sig)
caught_sigint = 1;
kill (rc_child, SIGKILL);
- if (no_reboot) _exit (1) /*kill (0, SIGKILL)*/;
+ if (no_reboot) _exit (EXIT_FAILURE) /*kill (0, SIGKILL)*/;
sync ();
sync ();
pid = fork ();
@@ -964,7 +964,7 @@ static void process_command (const struct command_struct *command)
{
FILE *fp;
- if ( ( fp = fopen (command->name, "w") ) == NULL ) _exit (1);
+ if ( ( fp = fopen (command->name, "w") ) == NULL ) _exit (EXIT_FAILURE);
show_scripts (fp, available_list.first, "AVAILABLE");
show_scripts (fp, starting_list.first, "STARTING");
fputs ("UNAVAILABLE SERVICES:\n", fp);
@@ -973,7 +973,7 @@ static void process_command (const struct command_struct *command)
fprintf (fp, "%s (%s)\n", service->name,
service->failed ? "FAILED" : "not configured");
fclose (fp);
- _exit (0);
+ _exit (EXIT_SUCCESS);
}
break;
case COMMAND_PROVIDE: