diff options
| author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2008-05-19 09:29:47 +0000 |
|---|---|---|
| committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2008-05-19 09:29:47 +0000 |
| commit | 636a1f85e89432601c59cdc3239fc867b4adf051 (patch) | |
| tree | d43c9ca120c29bf2d4567b1bb0674c6a8bae2b6d | |
| parent | cb83abd7b6b052224c1f3b998e863aac76914afd (diff) | |
| download | busybox-w32-636a1f85e89432601c59cdc3239fc867b4adf051.tar.gz busybox-w32-636a1f85e89432601c59cdc3239fc867b4adf051.tar.bz2 busybox-w32-636a1f85e89432601c59cdc3239fc867b4adf051.zip | |
- use EXIT_{SUCCESS,FAILURE}. No object-code changes
45 files changed, 85 insertions, 85 deletions
diff --git a/applets/individual.c b/applets/individual.c index 0c7a4b73e..414a11b05 100644 --- a/applets/individual.c +++ b/applets/individual.c | |||
| @@ -22,5 +22,5 @@ void bb_show_usage(void) | |||
| 22 | { | 22 | { |
| 23 | printf(APPLET_full_usage "\n"); | 23 | printf(APPLET_full_usage "\n"); |
| 24 | 24 | ||
| 25 | exit(1); | 25 | exit(EXIT_FAILURE); |
| 26 | } | 26 | } |
diff --git a/archival/libunarchive/get_header_tar.c b/archival/libunarchive/get_header_tar.c index 0be29b7ce..187552c28 100644 --- a/archival/libunarchive/get_header_tar.c +++ b/archival/libunarchive/get_header_tar.c | |||
| @@ -99,7 +99,7 @@ char get_header_tar(archive_handle_t *archive_handle) | |||
| 99 | * "tar: A lone zero block at N", where N = kilobyte | 99 | * "tar: A lone zero block at N", where N = kilobyte |
| 100 | * where EOF was met (not EOF block, actual EOF!), | 100 | * where EOF was met (not EOF block, actual EOF!), |
| 101 | * and tar will exit with error code 0. | 101 | * and tar will exit with error code 0. |
| 102 | * We will mimic exit(0), although we will not mimic | 102 | * We will mimic exit(EXIT_SUCCESS), although we will not mimic |
| 103 | * the message and we don't check whether we indeed | 103 | * the message and we don't check whether we indeed |
| 104 | * saw zero block directly before this. */ | 104 | * saw zero block directly before this. */ |
| 105 | if (i == 0) | 105 | if (i == 0) |
diff --git a/archival/libunarchive/open_transformer.c b/archival/libunarchive/open_transformer.c index 8fb860234..d0a2b7c36 100644 --- a/archival/libunarchive/open_transformer.c +++ b/archival/libunarchive/open_transformer.c | |||
| @@ -40,7 +40,7 @@ int open_transformer(int src_fd, | |||
| 40 | close(fd_pipe.wr); /* Send EOF */ | 40 | close(fd_pipe.wr); /* Send EOF */ |
| 41 | close(src_fd); | 41 | close(src_fd); |
| 42 | } | 42 | } |
| 43 | exit(0); | 43 | exit(EXIT_SUCCESS); |
| 44 | #else | 44 | #else |
| 45 | { | 45 | { |
| 46 | char *argv[4]; | 46 | char *argv[4]; |
diff --git a/archival/tar.c b/archival/tar.c index be59f0441..545081a01 100644 --- a/archival/tar.c +++ b/archival/tar.c | |||
| @@ -552,7 +552,7 @@ static void NOINLINE vfork_compressor(int tar_fd, int gzip) | |||
| 552 | /* exec gzip/bzip2 program/applet */ | 552 | /* exec gzip/bzip2 program/applet */ |
| 553 | BB_EXECLP(zip_exec, zip_exec, "-f", NULL); | 553 | BB_EXECLP(zip_exec, zip_exec, "-f", NULL); |
| 554 | vfork_exec_errno = errno; | 554 | vfork_exec_errno = errno; |
| 555 | _exit(1); | 555 | _exit(EXIT_FAILURE); |
| 556 | } | 556 | } |
| 557 | 557 | ||
| 558 | /* parent */ | 558 | /* parent */ |
diff --git a/console-tools/resize.c b/console-tools/resize.c index 01b1442f6..8a50f9dcd 100644 --- a/console-tools/resize.c +++ b/console-tools/resize.c | |||
| @@ -17,7 +17,7 @@ static void | |||
| 17 | onintr(int sig ATTRIBUTE_UNUSED) | 17 | onintr(int sig ATTRIBUTE_UNUSED) |
| 18 | { | 18 | { |
| 19 | tcsetattr(STDERR_FILENO, TCSANOW, &old_termios); | 19 | tcsetattr(STDERR_FILENO, TCSANOW, &old_termios); |
| 20 | exit(1); | 20 | exit(EXIT_FAILURE); |
| 21 | } | 21 | } |
| 22 | 22 | ||
| 23 | int resize_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 23 | int resize_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
diff --git a/coreutils/cal.c b/coreutils/cal.c index 8a08a9ae7..8a93057b0 100644 --- a/coreutils/cal.c +++ b/coreutils/cal.c | |||
| @@ -179,7 +179,7 @@ int cal_main(int argc, char **argv) | |||
| 179 | } | 179 | } |
| 180 | } | 180 | } |
| 181 | 181 | ||
| 182 | fflush_stdout_and_exit(0); | 182 | fflush_stdout_and_exit(EXIT_SUCCESS); |
| 183 | } | 183 | } |
| 184 | 184 | ||
| 185 | /* | 185 | /* |
diff --git a/coreutils/env.c b/coreutils/env.c index 20cf348d6..e21740d98 100644 --- a/coreutils/env.c +++ b/coreutils/env.c | |||
| @@ -85,7 +85,7 @@ int env_main(int argc ATTRIBUTE_UNUSED, char **argv) | |||
| 85 | puts(*ep); | 85 | puts(*ep); |
| 86 | } | 86 | } |
| 87 | 87 | ||
| 88 | fflush_stdout_and_exit(0); | 88 | fflush_stdout_and_exit(EXIT_SUCCESS); |
| 89 | } | 89 | } |
| 90 | 90 | ||
| 91 | /* | 91 | /* |
diff --git a/coreutils/printenv.c b/coreutils/printenv.c index 31d76d712..2fc01f22f 100644 --- a/coreutils/printenv.c +++ b/coreutils/printenv.c | |||
| @@ -29,5 +29,5 @@ int printenv_main(int argc ATTRIBUTE_UNUSED, char **argv) | |||
| 29 | } | 29 | } |
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | fflush_stdout_and_exit(0); | 32 | fflush_stdout_and_exit(EXIT_SUCCESS); |
| 33 | } | 33 | } |
diff --git a/coreutils/printf.c b/coreutils/printf.c index a12f7cae7..7c7613152 100644 --- a/coreutils/printf.c +++ b/coreutils/printf.c | |||
| @@ -266,7 +266,7 @@ static char **print_formatted(char *format, char **argv) | |||
| 266 | break; | 266 | break; |
| 267 | case '\\': | 267 | case '\\': |
| 268 | if (*++f == 'c') | 268 | if (*++f == 'c') |
| 269 | exit(0); | 269 | exit(EXIT_SUCCESS); |
| 270 | bb_putchar(bb_process_escape_sequence((const char **)&f)); | 270 | bb_putchar(bb_process_escape_sequence((const char **)&f)); |
| 271 | f--; | 271 | f--; |
| 272 | break; | 272 | break; |
diff --git a/debianutils/start_stop_daemon.c b/debianutils/start_stop_daemon.c index 524259979..8d73bdc80 100644 --- a/debianutils/start_stop_daemon.c +++ b/debianutils/start_stop_daemon.c | |||
| @@ -403,7 +403,7 @@ int start_stop_daemon_main(int argc ATTRIBUTE_UNUSED, char **argv) | |||
| 403 | /* parent */ | 403 | /* parent */ |
| 404 | /* why _exit? the child may have changed the stack, | 404 | /* why _exit? the child may have changed the stack, |
| 405 | * so "return 0" may do bad things */ | 405 | * so "return 0" may do bad things */ |
| 406 | _exit(0); | 406 | _exit(EXIT_SUCCESS); |
| 407 | } | 407 | } |
| 408 | /* child */ | 408 | /* child */ |
| 409 | setsid(); /* detach from controlling tty */ | 409 | setsid(); /* detach from controlling tty */ |
diff --git a/findutils/grep.c b/findutils/grep.c index b319e22ce..6af1b46e1 100644 --- a/findutils/grep.c +++ b/findutils/grep.c | |||
| @@ -35,7 +35,7 @@ | |||
| 35 | enum { | 35 | enum { |
| 36 | OPTBIT_l, /* list matched file names only */ | 36 | OPTBIT_l, /* list matched file names only */ |
| 37 | OPTBIT_n, /* print line# */ | 37 | OPTBIT_n, /* print line# */ |
| 38 | OPTBIT_q, /* quiet - exit(0) of first match */ | 38 | OPTBIT_q, /* quiet - exit(EXIT_SUCCESS) of first match */ |
| 39 | OPTBIT_v, /* invert the match, to select non-matching lines */ | 39 | OPTBIT_v, /* invert the match, to select non-matching lines */ |
| 40 | OPTBIT_s, /* suppress errors about file open errors */ | 40 | OPTBIT_s, /* suppress errors about file open errors */ |
| 41 | OPTBIT_c, /* count matches per file (suppresses normal output) */ | 41 | OPTBIT_c, /* count matches per file (suppresses normal output) */ |
| @@ -224,7 +224,7 @@ static int grep_file(FILE *file) | |||
| 224 | * "exit immediately with zero status | 224 | * "exit immediately with zero status |
| 225 | * if any match is found, | 225 | * if any match is found, |
| 226 | * even if errors were detected" */ | 226 | * even if errors were detected" */ |
| 227 | exit(0); | 227 | exit(EXIT_SUCCESS); |
| 228 | } | 228 | } |
| 229 | /* if we're just printing filenames, we stop after the first match */ | 229 | /* if we're just printing filenames, we stop after the first match */ |
| 230 | if (PRINT_FILES_WITH_MATCHES) { | 230 | if (PRINT_FILES_WITH_MATCHES) { |
diff --git a/findutils/xargs.c b/findutils/xargs.c index d1cf192b1..352f7e64c 100644 --- a/findutils/xargs.c +++ b/findutils/xargs.c | |||
| @@ -517,7 +517,7 @@ void bb_show_usage(void) | |||
| 517 | { | 517 | { |
| 518 | fprintf(stderr, "Usage: %s [-p] [-r] [-t] -[x] [-n max_arg] [-s max_chars]\n", | 518 | fprintf(stderr, "Usage: %s [-p] [-r] [-t] -[x] [-n max_arg] [-s max_chars]\n", |
| 519 | applet_name); | 519 | applet_name); |
| 520 | exit(1); | 520 | exit(EXIT_FAILURE); |
| 521 | } | 521 | } |
| 522 | 522 | ||
| 523 | int main(int argc, char **argv) | 523 | int main(int argc, char **argv) |
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) | |||
| 531 | static void init_reboot(unsigned long magic) | 531 | static 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 */ |
diff --git a/libbb/signals.c b/libbb/signals.c index 685c55230..1342c89a8 100644 --- a/libbb/signals.c +++ b/libbb/signals.c | |||
| @@ -89,7 +89,7 @@ void kill_myself_with_sig(int sig) | |||
| 89 | signal(sig, SIG_DFL); | 89 | signal(sig, SIG_DFL); |
| 90 | sig_unblock(sig); | 90 | sig_unblock(sig); |
| 91 | raise(sig); | 91 | raise(sig); |
| 92 | _exit(1); /* Should not reach it */ | 92 | _exit(EXIT_FAILURE); /* Should not reach it */ |
| 93 | } | 93 | } |
| 94 | 94 | ||
| 95 | void signal_SA_RESTART_empty_mask(int sig, void (*handler)(int)) | 95 | void signal_SA_RESTART_empty_mask(int sig, void (*handler)(int)) |
diff --git a/libbb/vfork_daemon_rexec.c b/libbb/vfork_daemon_rexec.c index 7064eb3fb..9624efbb9 100644 --- a/libbb/vfork_daemon_rexec.c +++ b/libbb/vfork_daemon_rexec.c | |||
| @@ -230,7 +230,7 @@ void forkexit_or_rexec(char **argv) | |||
| 230 | if (pid < 0) /* wtf? */ | 230 | if (pid < 0) /* wtf? */ |
| 231 | bb_perror_msg_and_die("vfork"); | 231 | bb_perror_msg_and_die("vfork"); |
| 232 | if (pid) /* parent */ | 232 | if (pid) /* parent */ |
| 233 | exit(0); | 233 | exit(EXIT_SUCCESS); |
| 234 | /* child - re-exec ourself */ | 234 | /* child - re-exec ourself */ |
| 235 | re_exec(argv); | 235 | re_exec(argv); |
| 236 | } | 236 | } |
| @@ -244,7 +244,7 @@ void forkexit_or_rexec(void) | |||
| 244 | if (pid < 0) /* wtf? */ | 244 | if (pid < 0) /* wtf? */ |
| 245 | bb_perror_msg_and_die("fork"); | 245 | bb_perror_msg_and_die("fork"); |
| 246 | if (pid) /* parent */ | 246 | if (pid) /* parent */ |
| 247 | exit(0); | 247 | exit(EXIT_SUCCESS); |
| 248 | /* child */ | 248 | /* child */ |
| 249 | } | 249 | } |
| 250 | #define forkexit_or_rexec(argv) forkexit_or_rexec() | 250 | #define forkexit_or_rexec(argv) forkexit_or_rexec() |
diff --git a/loginutils/getty.c b/loginutils/getty.c index 5e161823a..f022aec59 100644 --- a/loginutils/getty.c +++ b/loginutils/getty.c | |||
| @@ -423,7 +423,7 @@ static char *get_logname(char *logname, unsigned size_logname, | |||
| 423 | /* Do not report trivial EINTR/EIO errors. */ | 423 | /* Do not report trivial EINTR/EIO errors. */ |
| 424 | if (read(0, &c, 1) < 1) { | 424 | if (read(0, &c, 1) < 1) { |
| 425 | if (errno == EINTR || errno == EIO) | 425 | if (errno == EINTR || errno == EIO) |
| 426 | exit(0); | 426 | exit(EXIT_SUCCESS); |
| 427 | bb_perror_msg_and_die("%s: read", op->tty); | 427 | bb_perror_msg_and_die("%s: read", op->tty); |
| 428 | } | 428 | } |
| 429 | 429 | ||
| @@ -475,7 +475,7 @@ static char *get_logname(char *logname, unsigned size_logname, | |||
| 475 | } | 475 | } |
| 476 | break; | 476 | break; |
| 477 | case CTL('D'): | 477 | case CTL('D'): |
| 478 | exit(0); | 478 | exit(EXIT_SUCCESS); |
| 479 | default: | 479 | default: |
| 480 | if (!isascii(ascval) || !isprint(ascval)) { | 480 | if (!isascii(ascval) || !isprint(ascval)) { |
| 481 | /* ignore garbage characters */ | 481 | /* ignore garbage characters */ |
diff --git a/loginutils/login.c b/loginutils/login.c index e8fe74e16..900a7c042 100644 --- a/loginutils/login.c +++ b/loginutils/login.c | |||
| @@ -130,7 +130,7 @@ static void die_if_nologin(void) | |||
| 130 | fclose(fp); | 130 | fclose(fp); |
| 131 | } else | 131 | } else |
| 132 | puts("\r\nSystem closed for routine maintenance\r"); | 132 | puts("\r\nSystem closed for routine maintenance\r"); |
| 133 | exit(1); | 133 | exit(EXIT_FAILURE); |
| 134 | } | 134 | } |
| 135 | #else | 135 | #else |
| 136 | static ALWAYS_INLINE void die_if_nologin(void) {} | 136 | static ALWAYS_INLINE void die_if_nologin(void) {} |
| @@ -178,18 +178,18 @@ static void get_username_or_die(char *buf, int size_buf) | |||
| 178 | /* skip whitespace */ | 178 | /* skip whitespace */ |
| 179 | do { | 179 | do { |
| 180 | c = getchar(); | 180 | c = getchar(); |
| 181 | if (c == EOF) exit(1); | 181 | if (c == EOF) exit(EXIT_FAILURE); |
| 182 | if (c == '\n') { | 182 | if (c == '\n') { |
| 183 | if (!--cntdown) exit(1); | 183 | if (!--cntdown) exit(EXIT_FAILURE); |
| 184 | goto prompt; | 184 | goto prompt; |
| 185 | } | 185 | } |
| 186 | } while (isspace(c)); | 186 | } while (isspace(c)); |
| 187 | 187 | ||
| 188 | *buf++ = c; | 188 | *buf++ = c; |
| 189 | if (!fgets(buf, size_buf-2, stdin)) | 189 | if (!fgets(buf, size_buf-2, stdin)) |
| 190 | exit(1); | 190 | exit(EXIT_FAILURE); |
| 191 | if (!strchr(buf, '\n')) | 191 | if (!strchr(buf, '\n')) |
| 192 | exit(1); | 192 | exit(EXIT_FAILURE); |
| 193 | while (isgraph(*buf)) buf++; | 193 | while (isgraph(*buf)) buf++; |
| 194 | *buf = '\0'; | 194 | *buf = '\0'; |
| 195 | } | 195 | } |
diff --git a/loginutils/vlock.c b/loginutils/vlock.c index 96c1f679a..3ce40dd62 100644 --- a/loginutils/vlock.c +++ b/loginutils/vlock.c | |||
| @@ -102,5 +102,5 @@ int vlock_main(int argc ATTRIBUTE_UNUSED, char **argv) | |||
| 102 | 102 | ||
| 103 | ioctl(STDIN_FILENO, VT_SETMODE, &ovtm); | 103 | ioctl(STDIN_FILENO, VT_SETMODE, &ovtm); |
| 104 | tcsetattr(STDIN_FILENO, TCSANOW, &oterm); | 104 | tcsetattr(STDIN_FILENO, TCSANOW, &oterm); |
| 105 | fflush_stdout_and_exit(0); | 105 | fflush_stdout_and_exit(EXIT_SUCCESS); |
| 106 | } | 106 | } |
diff --git a/miscutils/crond.c b/miscutils/crond.c index 6db4df422..2bed5a4b1 100644 --- a/miscutils/crond.c +++ b/miscutils/crond.c | |||
| @@ -797,7 +797,7 @@ ForkJob(const char *user, CronLine *line, int mailFd, | |||
| 797 | if (mail_filename) { | 797 | if (mail_filename) { |
| 798 | fdprintf(1, "Exec failed: %s -c %s\n", prog, arg); | 798 | fdprintf(1, "Exec failed: %s -c %s\n", prog, arg); |
| 799 | } | 799 | } |
| 800 | _exit(0); | 800 | _exit(EXIT_SUCCESS); |
| 801 | } | 801 | } |
| 802 | 802 | ||
| 803 | line->cl_Pid = pid; | 803 | line->cl_Pid = pid; |
| @@ -930,7 +930,7 @@ static void RunJob(const char *user, CronLine *line) | |||
| 930 | execl(DEFAULT_SHELL, DEFAULT_SHELL, "-c", line->cl_Shell, NULL); | 930 | execl(DEFAULT_SHELL, DEFAULT_SHELL, "-c", line->cl_Shell, NULL); |
| 931 | crondlog(ERR20 "can't exec, user %s cmd %s %s %s", user, | 931 | crondlog(ERR20 "can't exec, user %s cmd %s %s %s", user, |
| 932 | DEFAULT_SHELL, "-c", line->cl_Shell); | 932 | DEFAULT_SHELL, "-c", line->cl_Shell); |
| 933 | _exit(0); | 933 | _exit(EXIT_SUCCESS); |
| 934 | } | 934 | } |
| 935 | if (pid < 0) { | 935 | if (pid < 0) { |
| 936 | /* FORK FAILED */ | 936 | /* FORK FAILED */ |
diff --git a/miscutils/devfsd.c b/miscutils/devfsd.c index bb6b679b9..782457ac7 100644 --- a/miscutils/devfsd.c +++ b/miscutils/devfsd.c | |||
| @@ -283,9 +283,9 @@ static const char bb_msg_variable_not_found[] ALIGN1 = "variable: %s not found"; | |||
| 283 | #else | 283 | #else |
| 284 | #define info_logger(p, fmt, args...) | 284 | #define info_logger(p, fmt, args...) |
| 285 | #define msg_logger(p, fmt, args...) | 285 | #define msg_logger(p, fmt, args...) |
| 286 | #define msg_logger_and_die(p, fmt, args...) exit(1) | 286 | #define msg_logger_and_die(p, fmt, args...) exit(EXIT_FAILURE) |
| 287 | #define error_logger(p, fmt, args...) | 287 | #define error_logger(p, fmt, args...) |
| 288 | #define error_logger_and_die(p, fmt, args...) exit(1) | 288 | #define error_logger_and_die(p, fmt, args...) exit(EXIT_FAILURE) |
| 289 | #endif | 289 | #endif |
| 290 | 290 | ||
| 291 | static void safe_memcpy(char *dest, const char *src, int len) | 291 | static void safe_memcpy(char *dest, const char *src, int len) |
| @@ -402,7 +402,7 @@ int devfsd_main(int argc, char **argv) | |||
| 402 | dir_operation(SERVICE, mount_point, 0, NULL); | 402 | dir_operation(SERVICE, mount_point, 0, NULL); |
| 403 | 403 | ||
| 404 | if (ENABLE_DEVFSD_FG_NP && no_polling) | 404 | if (ENABLE_DEVFSD_FG_NP && no_polling) |
| 405 | exit(0); | 405 | exit(EXIT_SUCCESS); |
| 406 | 406 | ||
| 407 | if (ENABLE_DEVFSD_VERBOSE || ENABLE_DEBUG) | 407 | if (ENABLE_DEVFSD_VERBOSE || ENABLE_DEBUG) |
| 408 | logmode = LOGMODE_BOTH; | 408 | logmode = LOGMODE_BOTH; |
diff --git a/miscutils/less.c b/miscutils/less.c index 25b91c0fe..f69bce97e 100644 --- a/miscutils/less.c +++ b/miscutils/less.c | |||
| @@ -882,7 +882,7 @@ static void colon_process(void) | |||
| 882 | change_file(-1); | 882 | change_file(-1); |
| 883 | break; | 883 | break; |
| 884 | case 'q': | 884 | case 'q': |
| 885 | less_exit(0); | 885 | less_exit(EXIT_SUCCESS); |
| 886 | break; | 886 | break; |
| 887 | case 'x': | 887 | case 'x': |
| 888 | change_file(0); | 888 | change_file(0); |
| @@ -1270,7 +1270,7 @@ static void keypress_process(int keypress) | |||
| 1270 | buffer_line(cur_fline); | 1270 | buffer_line(cur_fline); |
| 1271 | break; | 1271 | break; |
| 1272 | case 'q': case 'Q': | 1272 | case 'q': case 'Q': |
| 1273 | less_exit(0); | 1273 | less_exit(EXIT_SUCCESS); |
| 1274 | break; | 1274 | break; |
| 1275 | #if ENABLE_FEATURE_LESS_MARKS | 1275 | #if ENABLE_FEATURE_LESS_MARKS |
| 1276 | case 'm': | 1276 | case 'm': |
diff --git a/miscutils/time.c b/miscutils/time.c index ed4385948..a6d158c53 100644 --- a/miscutils/time.c +++ b/miscutils/time.c | |||
| @@ -424,5 +424,5 @@ int time_main(int argc ATTRIBUTE_UNUSED, char **argv) | |||
| 424 | return WTERMSIG(res.waitstatus); | 424 | return WTERMSIG(res.waitstatus); |
| 425 | if (WIFEXITED(res.waitstatus)) | 425 | if (WIFEXITED(res.waitstatus)) |
| 426 | return WEXITSTATUS(res.waitstatus); | 426 | return WEXITSTATUS(res.waitstatus); |
| 427 | fflush_stdout_and_exit(0); | 427 | fflush_stdout_and_exit(EXIT_SUCCESS); |
| 428 | } | 428 | } |
diff --git a/miscutils/watchdog.c b/miscutils/watchdog.c index a5061f5d7..4ad21cbc9 100644 --- a/miscutils/watchdog.c +++ b/miscutils/watchdog.c | |||
| @@ -20,7 +20,7 @@ static void watchdog_shutdown(int sig ATTRIBUTE_UNUSED) | |||
| 20 | write(3, &V, 1); /* Magic, see watchdog-api.txt in kernel */ | 20 | write(3, &V, 1); /* Magic, see watchdog-api.txt in kernel */ |
| 21 | if (ENABLE_FEATURE_CLEAN_UP) | 21 | if (ENABLE_FEATURE_CLEAN_UP) |
| 22 | close(3); | 22 | close(3); |
| 23 | exit(0); | 23 | exit(EXIT_SUCCESS); |
| 24 | } | 24 | } |
| 25 | 25 | ||
| 26 | int watchdog_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 26 | int watchdog_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
diff --git a/networking/inetd.c b/networking/inetd.c index 3be9dcb7f..08c09953b 100644 --- a/networking/inetd.c +++ b/networking/inetd.c | |||
| @@ -1124,7 +1124,7 @@ static void clean_up_and_exit(int sig ATTRIBUTE_UNUSED) | |||
| 1124 | close(sep->se_fd); | 1124 | close(sep->se_fd); |
| 1125 | } | 1125 | } |
| 1126 | remove_pidfile(_PATH_INETDPID); | 1126 | remove_pidfile(_PATH_INETDPID); |
| 1127 | exit(0); | 1127 | exit(EXIT_SUCCESS); |
| 1128 | } | 1128 | } |
| 1129 | 1129 | ||
| 1130 | int inetd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 1130 | int inetd_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
| @@ -1344,7 +1344,7 @@ int inetd_main(int argc ATTRIBUTE_UNUSED, char **argv) | |||
| 1344 | else | 1344 | else |
| 1345 | sep->se_builtin->bi_dgram_fn(ctrl, sep); | 1345 | sep->se_builtin->bi_dgram_fn(ctrl, sep); |
| 1346 | if (pid) /* we did vfork */ | 1346 | if (pid) /* we did vfork */ |
| 1347 | _exit(1); | 1347 | _exit(EXIT_FAILURE); |
| 1348 | maybe_close(accepted_fd); | 1348 | maybe_close(accepted_fd); |
| 1349 | continue; /* -> check next fd in fd set */ | 1349 | continue; /* -> check next fd in fd set */ |
| 1350 | } | 1350 | } |
| @@ -1408,7 +1408,7 @@ int inetd_main(int argc ATTRIBUTE_UNUSED, char **argv) | |||
| 1408 | /* eat packet in udp case */ | 1408 | /* eat packet in udp case */ |
| 1409 | if (sep->se_socktype != SOCK_STREAM) | 1409 | if (sep->se_socktype != SOCK_STREAM) |
| 1410 | recv(0, line, LINE_SIZE, MSG_DONTWAIT); | 1410 | recv(0, line, LINE_SIZE, MSG_DONTWAIT); |
| 1411 | _exit(1); | 1411 | _exit(EXIT_FAILURE); |
| 1412 | } /* for (sep = servtab...) */ | 1412 | } /* for (sep = servtab...) */ |
| 1413 | } /* for (;;) */ | 1413 | } /* for (;;) */ |
| 1414 | } | 1414 | } |
| @@ -1441,7 +1441,7 @@ static void echo_stream(int s, servtab_t *sep ATTRIBUTE_UNUSED) | |||
| 1441 | close(STDERR_FILENO); | 1441 | close(STDERR_FILENO); |
| 1442 | xopen("/dev/null", O_WRONLY); | 1442 | xopen("/dev/null", O_WRONLY); |
| 1443 | BB_EXECVP("cat", (char**)cat_args); | 1443 | BB_EXECVP("cat", (char**)cat_args); |
| 1444 | /* on failure we return to main, which does exit(1) */ | 1444 | /* on failure we return to main, which does exit(EXIT_FAILURE) */ |
| 1445 | #endif | 1445 | #endif |
| 1446 | } | 1446 | } |
| 1447 | static void echo_dg(int s, servtab_t *sep) | 1447 | static void echo_dg(int s, servtab_t *sep) |
| @@ -1479,7 +1479,7 @@ static void discard_stream(int s, servtab_t *sep ATTRIBUTE_UNUSED) | |||
| 1479 | /* no error messages please... */ | 1479 | /* no error messages please... */ |
| 1480 | xdup2(STDOUT_FILENO, STDERR_FILENO); | 1480 | xdup2(STDOUT_FILENO, STDERR_FILENO); |
| 1481 | BB_EXECVP("cat", (char**)cat_args); | 1481 | BB_EXECVP("cat", (char**)cat_args); |
| 1482 | /* on failure we return to main, which does exit(1) */ | 1482 | /* on failure we return to main, which does exit(EXIT_FAILURE) */ |
| 1483 | #endif | 1483 | #endif |
| 1484 | } | 1484 | } |
| 1485 | /* ARGSUSED */ | 1485 | /* ARGSUSED */ |
diff --git a/networking/libiproute/iptunnel.c b/networking/libiproute/iptunnel.c index 1190b6867..752d81264 100644 --- a/networking/libiproute/iptunnel.c +++ b/networking/libiproute/iptunnel.c | |||
| @@ -284,7 +284,7 @@ static void parse_args(char **argv, int cmd, struct ip_tunnel_parm *p) | |||
| 284 | struct ip_tunnel_parm old_p; | 284 | struct ip_tunnel_parm old_p; |
| 285 | memset(&old_p, 0, sizeof(old_p)); | 285 | memset(&old_p, 0, sizeof(old_p)); |
| 286 | if (do_get_ioctl(*argv, &old_p)) | 286 | if (do_get_ioctl(*argv, &old_p)) |
| 287 | exit(1); | 287 | exit(EXIT_FAILURE); |
| 288 | *p = old_p; | 288 | *p = old_p; |
| 289 | } | 289 | } |
| 290 | } | 290 | } |
diff --git a/networking/nc.c b/networking/nc.c index 7d4a6e047..27c58a8c8 100644 --- a/networking/nc.c +++ b/networking/nc.c | |||
| @@ -183,7 +183,7 @@ int nc_main(int argc, char **argv) | |||
| 183 | nread = safe_read(fd, iobuf, sizeof(iobuf)); | 183 | nread = safe_read(fd, iobuf, sizeof(iobuf)); |
| 184 | if (fd == cfd) { | 184 | if (fd == cfd) { |
| 185 | if (nread < 1) | 185 | if (nread < 1) |
| 186 | exit(0); | 186 | exit(EXIT_SUCCESS); |
| 187 | ofd = STDOUT_FILENO; | 187 | ofd = STDOUT_FILENO; |
| 188 | } else { | 188 | } else { |
| 189 | if (nread<1) { | 189 | if (nread<1) { |
diff --git a/networking/ping.c b/networking/ping.c index c3a71071c..3ac9481c8 100644 --- a/networking/ping.c +++ b/networking/ping.c | |||
| @@ -755,7 +755,7 @@ int ping_main(int argc ATTRIBUTE_UNUSED, char **argv) | |||
| 755 | 755 | ||
| 756 | dotted = xmalloc_sockaddr2dotted_noport(&lsa->u.sa); | 756 | dotted = xmalloc_sockaddr2dotted_noport(&lsa->u.sa); |
| 757 | ping(lsa); | 757 | ping(lsa); |
| 758 | print_stats_and_exit(0); | 758 | print_stats_and_exit(EXIT_SUCCESS); |
| 759 | /*return EXIT_SUCCESS;*/ | 759 | /*return EXIT_SUCCESS;*/ |
| 760 | } | 760 | } |
| 761 | #endif /* FEATURE_FANCY_PING */ | 761 | #endif /* FEATURE_FANCY_PING */ |
diff --git a/networking/slattach.c b/networking/slattach.c index 3ffbb3ba8..96dec7e5f 100644 --- a/networking/slattach.c +++ b/networking/slattach.c | |||
| @@ -110,13 +110,13 @@ static void set_state(struct termios *state, int encap) | |||
| 110 | /* Set encapsulation (SLIP, CSLIP, etc) */ | 110 | /* Set encapsulation (SLIP, CSLIP, etc) */ |
| 111 | if (ioctl_or_warn(handle, SIOCSIFENCAP, &encap) < 0) { | 111 | if (ioctl_or_warn(handle, SIOCSIFENCAP, &encap) < 0) { |
| 112 | bad: | 112 | bad: |
| 113 | restore_state_and_exit(1); | 113 | restore_state_and_exit(EXIT_FAILURE); |
| 114 | } | 114 | } |
| 115 | } | 115 | } |
| 116 | 116 | ||
| 117 | static void sig_handler(int signo ATTRIBUTE_UNUSED) | 117 | static void sig_handler(int signo ATTRIBUTE_UNUSED) |
| 118 | { | 118 | { |
| 119 | restore_state_and_exit(0); | 119 | restore_state_and_exit(EXIT_SUCCESS); |
| 120 | } | 120 | } |
| 121 | 121 | ||
| 122 | int slattach_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 122 | int slattach_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
| @@ -239,5 +239,5 @@ int slattach_main(int argc ATTRIBUTE_UNUSED, char **argv) | |||
| 239 | system(extcmd); | 239 | system(extcmd); |
| 240 | 240 | ||
| 241 | /* Restore states and exit */ | 241 | /* Restore states and exit */ |
| 242 | restore_state_and_exit(0); | 242 | restore_state_and_exit(EXIT_SUCCESS); |
| 243 | } | 243 | } |
diff --git a/networking/telnet.c b/networking/telnet.c index 32e9993d3..b357e690c 100644 --- a/networking/telnet.c +++ b/networking/telnet.c | |||
| @@ -122,7 +122,7 @@ static void conescape(void) | |||
| 122 | " e exit telnet\r\n"); | 122 | " e exit telnet\r\n"); |
| 123 | 123 | ||
| 124 | if (read(0, &b, 1) <= 0) | 124 | if (read(0, &b, 1) <= 0) |
| 125 | doexit(1); | 125 | doexit(EXIT_FAILURE); |
| 126 | 126 | ||
| 127 | switch (b) { | 127 | switch (b) { |
| 128 | case 'l': | 128 | case 'l': |
| @@ -143,7 +143,7 @@ static void conescape(void) | |||
| 143 | rawmode(); | 143 | rawmode(); |
| 144 | break; | 144 | break; |
| 145 | case 'e': | 145 | case 'e': |
| 146 | doexit(0); | 146 | doexit(EXIT_SUCCESS); |
| 147 | } | 147 | } |
| 148 | 148 | ||
| 149 | write_str(1, "continuing...\r\n"); | 149 | write_str(1, "continuing...\r\n"); |
| @@ -634,7 +634,7 @@ int telnet_main(int argc, char **argv) | |||
| 634 | { | 634 | { |
| 635 | len = read(0, G.buf, DATABUFSIZE); | 635 | len = read(0, G.buf, DATABUFSIZE); |
| 636 | if (len <= 0) | 636 | if (len <= 0) |
| 637 | doexit(0); | 637 | doexit(EXIT_SUCCESS); |
| 638 | TRACE(0, ("Read con: %d\n", len)); | 638 | TRACE(0, ("Read con: %d\n", len)); |
| 639 | handlenetoutput(len); | 639 | handlenetoutput(len); |
| 640 | } | 640 | } |
| @@ -648,7 +648,7 @@ int telnet_main(int argc, char **argv) | |||
| 648 | len = read(G.netfd, G.buf, DATABUFSIZE); | 648 | len = read(G.netfd, G.buf, DATABUFSIZE); |
| 649 | if (len <= 0) { | 649 | if (len <= 0) { |
| 650 | write_str(1, "Connection closed by foreign host\r\n"); | 650 | write_str(1, "Connection closed by foreign host\r\n"); |
| 651 | doexit(1); | 651 | doexit(EXIT_FAILURE); |
| 652 | } | 652 | } |
| 653 | TRACE(0, ("Read netfd (%d): %d\n", G.netfd, len)); | 653 | TRACE(0, ("Read netfd (%d): %d\n", G.netfd, len)); |
| 654 | handlenetinput(len); | 654 | handlenetinput(len); |
diff --git a/networking/telnetd.c b/networking/telnetd.c index e312c0b41..3660d788f 100644 --- a/networking/telnetd.c +++ b/networking/telnetd.c | |||
| @@ -262,7 +262,7 @@ make_new_session( | |||
| 262 | BB_EXECVP(loginpath, (char **)login_argv); | 262 | BB_EXECVP(loginpath, (char **)login_argv); |
| 263 | /* _exit is safer with vfork, and we shouldn't send message | 263 | /* _exit is safer with vfork, and we shouldn't send message |
| 264 | * to remote clients anyway */ | 264 | * to remote clients anyway */ |
| 265 | _exit(1); /*bb_perror_msg_and_die("execv %s", loginpath);*/ | 265 | _exit(EXIT_FAILURE); /*bb_perror_msg_and_die("execv %s", loginpath);*/ |
| 266 | } | 266 | } |
| 267 | 267 | ||
| 268 | /* Must match getopt32 string */ | 268 | /* Must match getopt32 string */ |
| @@ -281,7 +281,7 @@ free_session(struct tsession *ts) | |||
| 281 | struct tsession *t = sessions; | 281 | struct tsession *t = sessions; |
| 282 | 282 | ||
| 283 | if (option_mask32 & OPT_INETD) | 283 | if (option_mask32 & OPT_INETD) |
| 284 | exit(0); | 284 | exit(EXIT_SUCCESS); |
| 285 | 285 | ||
| 286 | /* Unlink this telnet session from the session list */ | 286 | /* Unlink this telnet session from the session list */ |
| 287 | if (t == ts) | 287 | if (t == ts) |
| @@ -325,7 +325,7 @@ free_session(struct tsession *ts) | |||
| 325 | 325 | ||
| 326 | #else /* !FEATURE_TELNETD_STANDALONE */ | 326 | #else /* !FEATURE_TELNETD_STANDALONE */ |
| 327 | 327 | ||
| 328 | /* Used in main() only, thus "return 0" actually is exit(0). */ | 328 | /* Used in main() only, thus "return 0" actually is exit(EXIT_SUCCESS). */ |
| 329 | #define free_session(ts) return 0 | 329 | #define free_session(ts) return 0 |
| 330 | 330 | ||
| 331 | #endif | 331 | #endif |
diff --git a/procps/top.c b/procps/top.c index ed74879d1..de30ffb28 100644 --- a/procps/top.c +++ b/procps/top.c | |||
| @@ -523,7 +523,7 @@ static void reset_term(void) | |||
| 523 | static void sig_catcher(int sig ATTRIBUTE_UNUSED) | 523 | static void sig_catcher(int sig ATTRIBUTE_UNUSED) |
| 524 | { | 524 | { |
| 525 | reset_term(); | 525 | reset_term(); |
| 526 | exit(1); | 526 | exit(EXIT_FAILURE); |
| 527 | } | 527 | } |
| 528 | #endif /* FEATURE_USE_TERMIOS */ | 528 | #endif /* FEATURE_USE_TERMIOS */ |
| 529 | 529 | ||
diff --git a/runit/runsv.c b/runit/runsv.c index 2ab034af6..e3b507d25 100644 --- a/runit/runsv.c +++ b/runit/runsv.c | |||
| @@ -640,7 +640,7 @@ int runsv_main(int argc ATTRIBUTE_UNUSED, char **argv) | |||
| 640 | 640 | ||
| 641 | if (svd[0].want == W_EXIT && svd[0].state == S_DOWN) { | 641 | if (svd[0].want == W_EXIT && svd[0].state == S_DOWN) { |
| 642 | if (svd[1].pid == 0) | 642 | if (svd[1].pid == 0) |
| 643 | _exit(0); | 643 | _exit(EXIT_SUCCESS); |
| 644 | if (svd[1].want != W_EXIT) { | 644 | if (svd[1].want != W_EXIT) { |
| 645 | svd[1].want = W_EXIT; | 645 | svd[1].want = W_EXIT; |
| 646 | /* stopservice(&svd[1]); */ | 646 | /* stopservice(&svd[1]); */ |
diff --git a/runit/runsvdir.c b/runit/runsvdir.c index 32e4764d1..b4450c00c 100644 --- a/runit/runsvdir.c +++ b/runit/runsvdir.c | |||
| @@ -343,7 +343,7 @@ int runsvdir_main(int argc ATTRIBUTE_UNUSED, char **argv) | |||
| 343 | 343 | ||
| 344 | switch (exitsoon) { | 344 | switch (exitsoon) { |
| 345 | case 1: | 345 | case 1: |
| 346 | _exit(0); | 346 | _exit(EXIT_SUCCESS); |
| 347 | case 2: | 347 | case 2: |
| 348 | for (i = 0; i < svnum; i++) | 348 | for (i = 0; i < svnum; i++) |
| 349 | if (sv[i].pid) | 349 | if (sv[i].pid) |
diff --git a/selinux/setfiles.c b/selinux/setfiles.c index 02bb9113f..82e9e5348 100644 --- a/selinux/setfiles.c +++ b/selinux/setfiles.c | |||
| @@ -612,7 +612,7 @@ int setfiles_main(int argc, char **argv) | |||
| 612 | optind++; | 612 | optind++; |
| 613 | 613 | ||
| 614 | if (nerr) | 614 | if (nerr) |
| 615 | exit(1); | 615 | exit(EXIT_FAILURE); |
| 616 | } | 616 | } |
| 617 | 617 | ||
| 618 | if (input_filename) { | 618 | if (input_filename) { |
diff --git a/shell/ash.c b/shell/ash.c index b45229ba5..fa063bf20 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
| @@ -4789,7 +4789,7 @@ openhere(union node *redir) | |||
| 4789 | full_write(pip[1], redir->nhere.doc->narg.text, len); | 4789 | full_write(pip[1], redir->nhere.doc->narg.text, len); |
| 4790 | else | 4790 | else |
| 4791 | expandhere(redir->nhere.doc, pip[1]); | 4791 | expandhere(redir->nhere.doc, pip[1]); |
| 4792 | _exit(0); | 4792 | _exit(EXIT_SUCCESS); |
| 4793 | } | 4793 | } |
| 4794 | out: | 4794 | out: |
| 4795 | close(pip[1]); | 4795 | close(pip[1]); |
diff --git a/shell/ash_test/printenv.c b/shell/ash_test/printenv.c index 06df21fdc..c4ccda8a6 100644 --- a/shell/ash_test/printenv.c +++ b/shell/ash_test/printenv.c | |||
| @@ -45,7 +45,7 @@ main (argc, argv) | |||
| 45 | { | 45 | { |
| 46 | for (envp = environ; *envp; envp++) | 46 | for (envp = environ; *envp; envp++) |
| 47 | puts (*envp); | 47 | puts (*envp); |
| 48 | exit (0); | 48 | exit(EXIT_SUCCESS); |
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | /* printenv varname */ | 51 | /* printenv varname */ |
| @@ -59,9 +59,9 @@ main (argc, argv) | |||
| 59 | if (*eval == '=') | 59 | if (*eval == '=') |
| 60 | { | 60 | { |
| 61 | puts (eval + 1); | 61 | puts (eval + 1); |
| 62 | exit (0); | 62 | exit(EXIT_SUCCESS); |
| 63 | } | 63 | } |
| 64 | } | 64 | } |
| 65 | } | 65 | } |
| 66 | exit (1); | 66 | exit(EXIT_FAILURE); |
| 67 | } | 67 | } |
diff --git a/shell/ash_test/recho.c b/shell/ash_test/recho.c index 02be0d760..fb48d9c48 100644 --- a/shell/ash_test/recho.c +++ b/shell/ash_test/recho.c | |||
| @@ -41,7 +41,7 @@ char **argv; | |||
| 41 | strprint(argv[i]); | 41 | strprint(argv[i]); |
| 42 | printf(">\n"); | 42 | printf(">\n"); |
| 43 | } | 43 | } |
| 44 | exit(0); | 44 | exit(EXIT_SUCCESS); |
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | void | 47 | void |
diff --git a/shell/ash_test/zecho.c b/shell/ash_test/zecho.c index 621d06d28..bf876f641 100644 --- a/shell/ash_test/zecho.c +++ b/shell/ash_test/zecho.c | |||
| @@ -35,5 +35,5 @@ char **argv; | |||
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | putchar('\n'); | 37 | putchar('\n'); |
| 38 | exit(0); | 38 | exit(EXIT_SUCCESS); |
| 39 | } | 39 | } |
diff --git a/shell/bbsh.c b/shell/bbsh.c index 02e60508f..5386bb097 100644 --- a/shell/bbsh.c +++ b/shell/bbsh.c | |||
| @@ -168,7 +168,7 @@ static int run_pipeline(struct pipeline *line) | |||
| 168 | run_applet_and_exit(cmd->argv[0],cmd->argc,cmd->argv); | 168 | run_applet_and_exit(cmd->argv[0],cmd->argc,cmd->argv); |
| 169 | execvp(cmd->argv[0],cmd->argv); | 169 | execvp(cmd->argv[0],cmd->argv); |
| 170 | printf("No %s",cmd->argv[0]); | 170 | printf("No %s",cmd->argv[0]); |
| 171 | exit(1); | 171 | exit(EXIT_FAILURE); |
| 172 | } else waitpid(pid, &status, 0); | 172 | } else waitpid(pid, &status, 0); |
| 173 | } | 173 | } |
| 174 | 174 | ||
diff --git a/shell/hush.c b/shell/hush.c index aa740f1b4..26d113b17 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
| @@ -1480,7 +1480,7 @@ static void pseudo_exec_argv(char **argv) | |||
| 1480 | debug_printf_exec("execing '%s'\n", argv[0]); | 1480 | debug_printf_exec("execing '%s'\n", argv[0]); |
| 1481 | execvp(argv[0], argv); | 1481 | execvp(argv[0], argv); |
| 1482 | bb_perror_msg("cannot exec '%s'", argv[0]); | 1482 | bb_perror_msg("cannot exec '%s'", argv[0]); |
| 1483 | _exit(1); | 1483 | _exit(EXIT_FAILURE); |
| 1484 | } | 1484 | } |
| 1485 | 1485 | ||
| 1486 | /* Called after [v]fork() in run_pipe() | 1486 | /* Called after [v]fork() in run_pipe() |
diff --git a/shell/msh.c b/shell/msh.c index aa6fb1d26..48fa56eb7 100644 --- a/shell/msh.c +++ b/shell/msh.c | |||
| @@ -2855,7 +2855,7 @@ static int forkexec(struct op *t, int *pin, int *pout, int no_fork, char **wp) | |||
| 2855 | if (t->op_type == TPAREN) | 2855 | if (t->op_type == TPAREN) |
| 2856 | _exit(execute(t->left, NOPIPE, NOPIPE, /* no_fork: */ 1)); | 2856 | _exit(execute(t->left, NOPIPE, NOPIPE, /* no_fork: */ 1)); |
| 2857 | if (wp[0] == NULL) | 2857 | if (wp[0] == NULL) |
| 2858 | _exit(0); | 2858 | _exit(EXIT_SUCCESS); |
| 2859 | 2859 | ||
| 2860 | cp = rexecve(wp[0], wp, makenv(0, NULL)); | 2860 | cp = rexecve(wp[0], wp, makenv(0, NULL)); |
| 2861 | prs(wp[0]); | 2861 | prs(wp[0]); |
| @@ -4207,7 +4207,7 @@ static int grave(int quoted) | |||
| 4207 | prs(argument_list[0]); | 4207 | prs(argument_list[0]); |
| 4208 | prs(": "); | 4208 | prs(": "); |
| 4209 | err(cp); | 4209 | err(cp); |
| 4210 | _exit(1); | 4210 | _exit(EXIT_FAILURE); |
| 4211 | } | 4211 | } |
| 4212 | 4212 | ||
| 4213 | 4213 | ||
| @@ -4733,7 +4733,7 @@ static int filechar(struct ioarg *ap) | |||
| 4733 | while (size == 0 || position >= size) { | 4733 | while (size == 0 || position >= size) { |
| 4734 | size = read_line_input(current_prompt, filechar_cmdbuf, BUFSIZ, line_input_state); | 4734 | size = read_line_input(current_prompt, filechar_cmdbuf, BUFSIZ, line_input_state); |
| 4735 | if (size < 0) /* Error/EOF */ | 4735 | if (size < 0) /* Error/EOF */ |
| 4736 | exit(0); | 4736 | exit(EXIT_SUCCESS); |
| 4737 | position = 0; | 4737 | position = 0; |
| 4738 | /* if Ctrl-C, size == 0 and loop will repeat */ | 4738 | /* if Ctrl-C, size == 0 and loop will repeat */ |
| 4739 | } | 4739 | } |
| @@ -5212,7 +5212,7 @@ int msh_main(int argc, char **argv) | |||
| 5212 | 5212 | ||
| 5213 | name = *++argv; | 5213 | name = *++argv; |
| 5214 | if (newfile(name)) | 5214 | if (newfile(name)) |
| 5215 | exit(1); /* Exit on error */ | 5215 | exit(EXIT_FAILURE); /* Exit on error */ |
| 5216 | } | 5216 | } |
| 5217 | } | 5217 | } |
| 5218 | 5218 | ||
diff --git a/sysklogd/logread.c b/sysklogd/logread.c index af93aab6e..7eb8db176 100644 --- a/sysklogd/logread.c +++ b/sysklogd/logread.c | |||
| @@ -64,7 +64,7 @@ static void interrupted(int sig ATTRIBUTE_UNUSED) | |||
| 64 | { | 64 | { |
| 65 | signal(SIGINT, SIG_IGN); | 65 | signal(SIGINT, SIG_IGN); |
| 66 | shmdt(shbuf); | 66 | shmdt(shbuf); |
| 67 | exit(0); | 67 | exit(EXIT_SUCCESS); |
| 68 | } | 68 | } |
| 69 | 69 | ||
| 70 | int logread_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 70 | int logread_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
diff --git a/util-linux/fdisk.c b/util-linux/fdisk.c index 50ab48dab..5871a065a 100644 --- a/util-linux/fdisk.c +++ b/util-linux/fdisk.c | |||
| @@ -394,7 +394,7 @@ read_line(const char *prompt) | |||
| 394 | 394 | ||
| 395 | sz = read_line_input(prompt, line_buffer, sizeof(line_buffer), NULL); | 395 | sz = read_line_input(prompt, line_buffer, sizeof(line_buffer), NULL); |
| 396 | if (sz <= 0) | 396 | if (sz <= 0) |
| 397 | exit(0); /* Ctrl-D or Ctrl-C */ | 397 | exit(EXIT_SUCCESS); /* Ctrl-D or Ctrl-C */ |
| 398 | 398 | ||
| 399 | if (line_buffer[sz-1] == '\n') | 399 | if (line_buffer[sz-1] == '\n') |
| 400 | line_buffer[--sz] = '\0'; | 400 | line_buffer[--sz] = '\0'; |
| @@ -2620,7 +2620,7 @@ xselect(void) | |||
| 2620 | if (ENABLE_FEATURE_CLEAN_UP) | 2620 | if (ENABLE_FEATURE_CLEAN_UP) |
| 2621 | close_dev_fd(); | 2621 | close_dev_fd(); |
| 2622 | bb_putchar('\n'); | 2622 | bb_putchar('\n'); |
| 2623 | exit(0); | 2623 | exit(EXIT_SUCCESS); |
| 2624 | case 'r': | 2624 | case 'r': |
| 2625 | return; | 2625 | return; |
| 2626 | case 's': | 2626 | case 's': |
diff --git a/util-linux/ipcrm.c b/util-linux/ipcrm.c index 8d5f63c0f..5dcda859a 100644 --- a/util-linux/ipcrm.c +++ b/util-linux/ipcrm.c | |||
| @@ -111,7 +111,7 @@ int ipcrm_main(int argc, char **argv) | |||
| 111 | what = SEM; | 111 | what = SEM; |
| 112 | 112 | ||
| 113 | if (remove_ids(what, argc-2, &argv[2])) | 113 | if (remove_ids(what, argc-2, &argv[2])) |
| 114 | fflush_stdout_and_exit(1); | 114 | fflush_stdout_and_exit(EXIT_FAILURE); |
| 115 | printf("resource(s) deleted\n"); | 115 | printf("resource(s) deleted\n"); |
| 116 | return 0; | 116 | return 0; |
| 117 | } | 117 | } |
diff --git a/util-linux/ipcs.c b/util-linux/ipcs.c index 4b5c597e5..111defa1e 100644 --- a/util-linux/ipcs.c +++ b/util-linux/ipcs.c | |||
| @@ -588,15 +588,15 @@ int ipcs_main(int argc ATTRIBUTE_UNUSED, char **argv) | |||
| 588 | if (flags & flag_print) { | 588 | if (flags & flag_print) { |
| 589 | if (flags & flag_shm) { | 589 | if (flags & flag_shm) { |
| 590 | print_shm(id); | 590 | print_shm(id); |
| 591 | fflush_stdout_and_exit(0); | 591 | fflush_stdout_and_exit(EXIT_SUCCESS); |
| 592 | } | 592 | } |
| 593 | if (flags & flag_sem) { | 593 | if (flags & flag_sem) { |
| 594 | print_sem(id); | 594 | print_sem(id); |
| 595 | fflush_stdout_and_exit(0); | 595 | fflush_stdout_and_exit(EXIT_SUCCESS); |
| 596 | } | 596 | } |
| 597 | if (flags & flag_msg) { | 597 | if (flags & flag_msg) { |
| 598 | print_msg(id); | 598 | print_msg(id); |
| 599 | fflush_stdout_and_exit(0); | 599 | fflush_stdout_and_exit(EXIT_SUCCESS); |
| 600 | } | 600 | } |
| 601 | bb_show_usage(); | 601 | bb_show_usage(); |
| 602 | } | 602 | } |
| @@ -617,5 +617,5 @@ int ipcs_main(int argc ATTRIBUTE_UNUSED, char **argv) | |||
| 617 | do_msg(); | 617 | do_msg(); |
| 618 | bb_putchar('\n'); | 618 | bb_putchar('\n'); |
| 619 | } | 619 | } |
| 620 | fflush_stdout_and_exit(0); | 620 | fflush_stdout_and_exit(EXIT_SUCCESS); |
| 621 | } | 621 | } |
