From 84228d125ec569c31bbe9092245c37439aef4aab Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Fri, 10 Dec 2010 15:52:44 +0100 Subject: [PATCH] simpleinit: Use EXIT_* [kzak@redhat.com: use the main() part of the patch] Signed-off-by: Karel Zak --- login-utils/simpleinit.c | 12 ++++++------ 1 file 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: -- 2.39.5