From db5546ca101846f18294a43b39883bc4ff53613a Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 5 Jan 2022 22:16:06 +0100 Subject: 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 --- init/init.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'init') diff --git a/init/init.c b/init/init.c index efab5dc..785a3b4 100644 --- a/init/init.c +++ b/init/init.c @@ -744,7 +744,7 @@ static void pause_and_low_level_reboot(unsigned magic) pid = vfork(); if (pid == 0) { /* child */ reboot(magic); - _exit(EXIT_SUCCESS); + _exit_SUCCESS(); } /* Used to have "while (1) sleep(1)" here. * However, in containers reboot() call is ignored, and with that loop @@ -752,7 +752,7 @@ static void pause_and_low_level_reboot(unsigned magic) */ waitpid(pid, NULL, 0); sleep1(); /* paranoia */ - _exit(EXIT_SUCCESS); + _exit_SUCCESS(); } static void run_shutdown_and_kill_processes(void) @@ -942,7 +942,7 @@ static void reload_inittab(void) for (a = G.init_action_list; a; a = a->next) if (a->action_type == 0 && a->pid != 0) kill(a->pid, SIGKILL); - _exit(EXIT_SUCCESS); + _exit_SUCCESS(); } } #endif -- cgit v1.1