summaryrefslogtreecommitdiff
path: root/init/init.c
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer2008-05-19 09:29:47 +0000
committerBernhard Reutner-Fischer2008-05-19 09:29:47 +0000
commit636a1f85e89432601c59cdc3239fc867b4adf051 (patch)
treed43c9ca120c29bf2d4567b1bb0674c6a8bae2b6d /init/init.c
parentcb83abd7b6b052224c1f3b998e863aac76914afd (diff)
downloadbusybox-636a1f85e89432601c59cdc3239fc867b4adf051.zip
busybox-636a1f85e89432601c59cdc3239fc867b4adf051.tar.gz
- use EXIT_{SUCCESS,FAILURE}. No object-code changes
Diffstat (limited to 'init/init.c')
-rw-r--r--init/init.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/init/init.c b/init/init.c
index e2fde5f..63154ce 100644
--- a/init/init.c
+++ b/init/init.c
@@ -301,7 +301,7 @@ static void open_stdio_to_tty(const char* tty_name, int exit_on_failure)
message(L_LOG | L_CONSOLE, "Can't open %s: %s",
tty_name, strerror(errno));
if (exit_on_failure)
- _exit(1);
+ _exit(EXIT_FAILURE);
if (ENABLE_DEBUG_INIT)
_exit(2);
/* NB: we don't reach this if we were called after vfork.
@@ -415,7 +415,7 @@ static pid_t run(const struct init_action *a)
pid = fork();
if (pid < 0) {
message(L_LOG | L_CONSOLE, "Can't fork");
- _exit(1);
+ _exit(EXIT_FAILURE);
}
if (pid > 0) {
@@ -430,21 +430,21 @@ static pid_t run(const struct init_action *a)
waitfor(pid);
/* See if stealing the controlling tty back is necessary */
if (tcgetpgrp(0) != getpid())
- _exit(0);
+ _exit(EXIT_SUCCESS);
/* Use a temporary process to steal the controlling tty. */
pid = fork();
if (pid < 0) {
message(L_LOG | L_CONSOLE, "Can't fork");
- _exit(1);
+ _exit(EXIT_FAILURE);
}
if (pid == 0) {
setsid();
ioctl(0, TIOCSCTTY, 1);
- _exit(0);
+ _exit(EXIT_SUCCESS);
}
waitfor(pid);
- _exit(0);
+ _exit(EXIT_SUCCESS);
}
/* Child - fall though to actually execute things */
@@ -531,13 +531,13 @@ static void run_actions(int action_type)
static void init_reboot(unsigned long magic)
{
pid_t pid;
- /* We have to fork here, since the kernel calls do_exit(0) in
+ /* We have to fork here, since the kernel calls do_exit(EXIT_SUCCESS) in
* linux/kernel/sys.c, which can cause the machine to panic when
* the init process is killed.... */
pid = vfork();
if (pid == 0) { /* child */
reboot(magic);
- _exit(0);
+ _exit(EXIT_SUCCESS);
}
waitfor(pid);
}
@@ -821,7 +821,7 @@ static void reload_signal(int sig ATTRIBUTE_UNUSED)
kill(pid, SIGKILL);
}
}
- _exit(0);
+ _exit(EXIT_SUCCESS);
}
#endif
}
@@ -936,7 +936,7 @@ int init_main(int argc ATTRIBUTE_UNUSED, char **argv)
/* SELinux in enforcing mode but load_policy failed */
message(L_CONSOLE, "Cannot load SELinux Policy. "
"Machine is in enforcing mode. Halting now.");
- exit(1);
+ exit(EXIT_FAILURE);
}
}
#endif /* CONFIG_SELINUX */