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 /util-linux | |
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 'util-linux')
-rw-r--r-- | util-linux/fdisk.c | 4 | ||||
-rw-r--r-- | util-linux/fdisk_osf.c | 4 | ||||
-rw-r--r-- | util-linux/fsck_minix.c | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/util-linux/fdisk.c b/util-linux/fdisk.c index 1c2a7d683..9c393b8fc 100644 --- a/util-linux/fdisk.c +++ b/util-linux/fdisk.c | |||
@@ -665,7 +665,7 @@ read_line(const char *prompt) | |||
665 | 665 | ||
666 | sz = read_line_input(NULL, prompt, line_buffer, sizeof(line_buffer)); | 666 | sz = read_line_input(NULL, prompt, line_buffer, sizeof(line_buffer)); |
667 | if (sz <= 0) | 667 | if (sz <= 0) |
668 | exit(EXIT_SUCCESS); /* Ctrl-D or Ctrl-C */ | 668 | exit_SUCCESS(); /* Ctrl-D or Ctrl-C */ |
669 | 669 | ||
670 | if (line_buffer[sz-1] == '\n') | 670 | if (line_buffer[sz-1] == '\n') |
671 | line_buffer[--sz] = '\0'; | 671 | line_buffer[--sz] = '\0'; |
@@ -2855,7 +2855,7 @@ xselect(void) | |||
2855 | if (ENABLE_FEATURE_CLEAN_UP) | 2855 | if (ENABLE_FEATURE_CLEAN_UP) |
2856 | close_dev_fd(); | 2856 | close_dev_fd(); |
2857 | bb_putchar('\n'); | 2857 | bb_putchar('\n'); |
2858 | exit(EXIT_SUCCESS); | 2858 | exit_SUCCESS(); |
2859 | case 'r': | 2859 | case 'r': |
2860 | return; | 2860 | return; |
2861 | case 's': | 2861 | case 's': |
diff --git a/util-linux/fdisk_osf.c b/util-linux/fdisk_osf.c index 765740ff1..6c66c130d 100644 --- a/util-linux/fdisk_osf.c +++ b/util-linux/fdisk_osf.c | |||
@@ -383,7 +383,7 @@ bsd_select(void) | |||
383 | 383 | ||
384 | if (xbsd_readlabel(NULL) == 0) | 384 | if (xbsd_readlabel(NULL) == 0) |
385 | if (xbsd_create_disklabel() == 0) | 385 | if (xbsd_create_disklabel() == 0) |
386 | exit(EXIT_SUCCESS); | 386 | exit_SUCCESS(); |
387 | 387 | ||
388 | #endif | 388 | #endif |
389 | 389 | ||
@@ -411,7 +411,7 @@ bsd_select(void) | |||
411 | case 'q': | 411 | case 'q': |
412 | if (ENABLE_FEATURE_CLEAN_UP) | 412 | if (ENABLE_FEATURE_CLEAN_UP) |
413 | close_dev_fd(); | 413 | close_dev_fd(); |
414 | exit(EXIT_SUCCESS); | 414 | exit_SUCCESS(); |
415 | case 'r': | 415 | case 'r': |
416 | return; | 416 | return; |
417 | case 's': | 417 | case 's': |
diff --git a/util-linux/fsck_minix.c b/util-linux/fsck_minix.c index 40b86d01b..dd2265c32 100644 --- a/util-linux/fsck_minix.c +++ b/util-linux/fsck_minix.c | |||
@@ -423,7 +423,7 @@ static void check_mount(void) | |||
423 | cont = ask("Do you really want to continue", 0); | 423 | cont = ask("Do you really want to continue", 0); |
424 | if (!cont) { | 424 | if (!cont) { |
425 | puts("Check aborted"); | 425 | puts("Check aborted"); |
426 | exit(EXIT_SUCCESS); | 426 | exit_SUCCESS(); |
427 | } | 427 | } |
428 | } | 428 | } |
429 | } | 429 | } |