diff options
author | Marek Polacek <mmpolacek@gmail.com> | 2010-12-10 15:52:44 +0100 |
---|---|---|
committer | Karel Zak <kzak@redhat.com> | 2010-12-10 15:52:44 +0100 |
commit | 84228d125ec569c31bbe9092245c37439aef4aab (patch) | |
tree | 91d5c146d84717ce0770d8cfd48084d81176f999 | |
parent | 713e0eeed4db41066149fa00301f64de2272c59e (diff) | |
download | util-linux-old-84228d125ec569c31bbe9092245c37439aef4aab.tar.gz |
simpleinit: Use EXIT_*
[kzak@redhat.com: use the main() part of the patch]
Signed-off-by: Karel Zak <kzak@redhat.com>
-rw-r--r-- | login-utils/simpleinit.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/login-utils/simpleinit.c b/login-utils/simpleinit.c index 9277a3cc..d1f62641 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: |