summaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2008-05-19 09:29:47 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2008-05-19 09:29:47 +0000
commit636a1f85e89432601c59cdc3239fc867b4adf051 (patch)
treed43c9ca120c29bf2d4567b1bb0674c6a8bae2b6d /init
parentcb83abd7b6b052224c1f3b998e863aac76914afd (diff)
downloadbusybox-w32-636a1f85e89432601c59cdc3239fc867b4adf051.tar.gz
busybox-w32-636a1f85e89432601c59cdc3239fc867b4adf051.tar.bz2
busybox-w32-636a1f85e89432601c59cdc3239fc867b4adf051.zip
- use EXIT_{SUCCESS,FAILURE}. No object-code changes
Diffstat (limited to 'init')
-rw-r--r--init/init.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/init/init.c b/init/init.c
index e2fde5f23..63154ce89 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)
301 message(L_LOG | L_CONSOLE, "Can't open %s: %s", 301 message(L_LOG | L_CONSOLE, "Can't open %s: %s",
302 tty_name, strerror(errno)); 302 tty_name, strerror(errno));
303 if (exit_on_failure) 303 if (exit_on_failure)
304 _exit(1); 304 _exit(EXIT_FAILURE);
305 if (ENABLE_DEBUG_INIT) 305 if (ENABLE_DEBUG_INIT)
306 _exit(2); 306 _exit(2);
307 /* NB: we don't reach this if we were called after vfork. 307 /* 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)
415 pid = fork(); 415 pid = fork();
416 if (pid < 0) { 416 if (pid < 0) {
417 message(L_LOG | L_CONSOLE, "Can't fork"); 417 message(L_LOG | L_CONSOLE, "Can't fork");
418 _exit(1); 418 _exit(EXIT_FAILURE);
419 } 419 }
420 420
421 if (pid > 0) { 421 if (pid > 0) {
@@ -430,21 +430,21 @@ static pid_t run(const struct init_action *a)
430 waitfor(pid); 430 waitfor(pid);
431 /* See if stealing the controlling tty back is necessary */ 431 /* See if stealing the controlling tty back is necessary */
432 if (tcgetpgrp(0) != getpid()) 432 if (tcgetpgrp(0) != getpid())
433 _exit(0); 433 _exit(EXIT_SUCCESS);
434 434
435 /* Use a temporary process to steal the controlling tty. */ 435 /* Use a temporary process to steal the controlling tty. */
436 pid = fork(); 436 pid = fork();
437 if (pid < 0) { 437 if (pid < 0) {
438 message(L_LOG | L_CONSOLE, "Can't fork"); 438 message(L_LOG | L_CONSOLE, "Can't fork");
439 _exit(1); 439 _exit(EXIT_FAILURE);
440 } 440 }
441 if (pid == 0) { 441 if (pid == 0) {
442 setsid(); 442 setsid();
443 ioctl(0, TIOCSCTTY, 1); 443 ioctl(0, TIOCSCTTY, 1);
444 _exit(0); 444 _exit(EXIT_SUCCESS);
445 } 445 }
446 waitfor(pid); 446 waitfor(pid);
447 _exit(0); 447 _exit(EXIT_SUCCESS);
448 } 448 }
449 449
450 /* Child - fall though to actually execute things */ 450 /* Child - fall though to actually execute things */
@@ -531,13 +531,13 @@ static void run_actions(int action_type)
531static void init_reboot(unsigned long magic) 531static void init_reboot(unsigned long magic)
532{ 532{
533 pid_t pid; 533 pid_t pid;
534 /* We have to fork here, since the kernel calls do_exit(0) in 534 /* We have to fork here, since the kernel calls do_exit(EXIT_SUCCESS) in
535 * linux/kernel/sys.c, which can cause the machine to panic when 535 * linux/kernel/sys.c, which can cause the machine to panic when
536 * the init process is killed.... */ 536 * the init process is killed.... */
537 pid = vfork(); 537 pid = vfork();
538 if (pid == 0) { /* child */ 538 if (pid == 0) { /* child */
539 reboot(magic); 539 reboot(magic);
540 _exit(0); 540 _exit(EXIT_SUCCESS);
541 } 541 }
542 waitfor(pid); 542 waitfor(pid);
543} 543}
@@ -821,7 +821,7 @@ static void reload_signal(int sig ATTRIBUTE_UNUSED)
821 kill(pid, SIGKILL); 821 kill(pid, SIGKILL);
822 } 822 }
823 } 823 }
824 _exit(0); 824 _exit(EXIT_SUCCESS);
825 } 825 }
826#endif 826#endif
827 } 827 }
@@ -936,7 +936,7 @@ int init_main(int argc ATTRIBUTE_UNUSED, char **argv)
936 /* SELinux in enforcing mode but load_policy failed */ 936 /* SELinux in enforcing mode but load_policy failed */
937 message(L_CONSOLE, "Cannot load SELinux Policy. " 937 message(L_CONSOLE, "Cannot load SELinux Policy. "
938 "Machine is in enforcing mode. Halting now."); 938 "Machine is in enforcing mode. Halting now.");
939 exit(1); 939 exit(EXIT_FAILURE);
940 } 940 }
941 } 941 }
942#endif /* CONFIG_SELINUX */ 942#endif /* CONFIG_SELINUX */