diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2022-01-05 22:16:06 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2022-01-05 22:16:06 +0100 |
commit | db5546ca101846f18294a43b39883bc4ff53613a (patch) | |
tree | f8bb8a4835b70f4693dcf83edfa432c21d0ee77f /loginutils | |
parent | 076f5e064fa7b6cc2c03b030abcf2cbd60514180 (diff) | |
download | busybox-w32-db5546ca101846f18294a43b39883bc4ff53613a.tar.gz busybox-w32-db5546ca101846f18294a43b39883bc4ff53613a.tar.bz2 busybox-w32-db5546ca101846f18294a43b39883bc4ff53613a.zip |
libbb: code shrink: introduce and use [_]exit_SUCCESS()
function old new delta
exit_SUCCESS - 7 +7
_exit_SUCCESS - 7 +7
run_pipe 1562 1567 +5
pseudo_exec_argv 399 400 +1
finish 86 87 +1
start_stop_daemon_main 1109 1107 -2
shutdown_on_signal 38 36 -2
runsv_main 1662 1660 -2
redirect 1070 1068 -2
read_line 79 77 -2
pause_and_low_level_reboot 54 52 -2
list_i2c_busses_and_exit 483 481 -2
less_exit 12 10 -2
identify 4123 4121 -2
grep_file 1161 1159 -2
getty_main 1519 1517 -2
fsck_minix_main 2681 2679 -2
free_session 132 130 -2
fdisk_main 4739 4737 -2
clean_up_and_exit 53 51 -2
bsd_select 1566 1564 -2
bb_daemonize_or_rexec 198 196 -2
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 3/17 up/down: 21/-34) Total: -13 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'loginutils')
-rw-r--r-- | loginutils/getty.c | 6 | ||||
-rw-r--r-- | loginutils/login.c | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/loginutils/getty.c b/loginutils/getty.c index 6c6d409f4..cd6378d80 100644 --- a/loginutils/getty.c +++ b/loginutils/getty.c | |||
@@ -484,7 +484,7 @@ static char *get_logname(void) | |||
484 | if (read(STDIN_FILENO, &c, 1) < 1) { | 484 | if (read(STDIN_FILENO, &c, 1) < 1) { |
485 | finalize_tty_attrs(); | 485 | finalize_tty_attrs(); |
486 | if (errno == EINTR || errno == EIO) | 486 | if (errno == EINTR || errno == EIO) |
487 | exit(EXIT_SUCCESS); | 487 | exit_SUCCESS(); |
488 | bb_simple_perror_msg_and_die(bb_msg_read_error); | 488 | bb_simple_perror_msg_and_die(bb_msg_read_error); |
489 | } | 489 | } |
490 | 490 | ||
@@ -511,7 +511,7 @@ static char *get_logname(void) | |||
511 | case CTL('C'): | 511 | case CTL('C'): |
512 | case CTL('D'): | 512 | case CTL('D'): |
513 | finalize_tty_attrs(); | 513 | finalize_tty_attrs(); |
514 | exit(EXIT_SUCCESS); | 514 | exit_SUCCESS(); |
515 | case '\0': | 515 | case '\0': |
516 | /* BREAK. If we have speeds to try, | 516 | /* BREAK. If we have speeds to try, |
517 | * return NULL (will switch speeds and return here) */ | 517 | * return NULL (will switch speeds and return here) */ |
@@ -538,7 +538,7 @@ static char *get_logname(void) | |||
538 | static void alarm_handler(int sig UNUSED_PARAM) | 538 | static void alarm_handler(int sig UNUSED_PARAM) |
539 | { | 539 | { |
540 | finalize_tty_attrs(); | 540 | finalize_tty_attrs(); |
541 | _exit(EXIT_SUCCESS); | 541 | _exit_SUCCESS(); |
542 | } | 542 | } |
543 | 543 | ||
544 | static void sleep10(void) | 544 | static void sleep10(void) |
diff --git a/loginutils/login.c b/loginutils/login.c index ce87e318a..569053c12 100644 --- a/loginutils/login.c +++ b/loginutils/login.c | |||
@@ -312,7 +312,7 @@ static void alarm_handler(int sig UNUSED_PARAM) | |||
312 | /* unix API is brain damaged regarding O_NONBLOCK, | 312 | /* unix API is brain damaged regarding O_NONBLOCK, |
313 | * we should undo it, or else we can affect other processes */ | 313 | * we should undo it, or else we can affect other processes */ |
314 | ndelay_off(STDOUT_FILENO); | 314 | ndelay_off(STDOUT_FILENO); |
315 | _exit(EXIT_SUCCESS); | 315 | _exit_SUCCESS(); |
316 | } | 316 | } |
317 | 317 | ||
318 | int login_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 318 | int login_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |