From 648f506949ded749e28186d0092b6e42085c897b Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 15 Jun 2023 11:55:56 +0200 Subject: libbb: code shrink: introduce and use [_]exit_FAILURE() function old new delta exit_FAILURE - 7 +7 _exit_FAILURE - 7 +7 run 198 199 +1 restore_state_and_exit 114 115 +1 xbsd_write_bootstrap 399 397 -2 vfork_compressor 209 207 -2 sig_handler 12 10 -2 serial_ctl 154 152 -2 parse_args 1169 1167 -2 onintr 21 19 -2 make_new_session 493 491 -2 login_main 988 986 -2 gotsig 35 33 -2 do_iplink 1315 1313 -2 addgroup_main 397 395 -2 inetd_main 1911 1908 -3 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 2/12 up/down: 16/-25) Total: -9 bytes Signed-off-by: Denys Vlasenko --- util-linux/fdisk_osf.c | 5 +++-- util-linux/more.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'util-linux') diff --git a/util-linux/fdisk_osf.c b/util-linux/fdisk_osf.c index 6c66c130d..049f0b169 100644 --- a/util-linux/fdisk_osf.c +++ b/util-linux/fdisk_osf.c @@ -746,11 +746,12 @@ xbsd_write_bootstrap(void) return; e = d + sizeof(struct xbsd_disklabel); - for (p = d; p < e; p++) + for (p = d; p < e; p++) { if (*p) { printf("Bootstrap overlaps with disk label!\n"); - exit(EXIT_FAILURE); + exit_FAILURE(); } + } memmove(d, &dl, sizeof(struct xbsd_disklabel)); diff --git a/util-linux/more.c b/util-linux/more.c index a830dcbc1..352a3b6cf 100644 --- a/util-linux/more.c +++ b/util-linux/more.c @@ -65,7 +65,7 @@ static void gotsig(int sig UNUSED_PARAM) * therefore it is safe in signal handler */ bb_putchar_stderr('\n'); tcsetattr_tty_TCSANOW(&G.initial_settings); - _exit(EXIT_FAILURE); + _exit_FAILURE(); } #define CONVERTED_TAB_SIZE 8 -- cgit v1.2.3