From 03ed86b39e887b2f4031961673fddd88fdeb493e Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 28 Sep 2021 17:40:59 +0200 Subject: libbb: code shrink in main() and scripted_main() function old new delta main 68 65 -3 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-3) Total: -3 bytes text data bss dec hex filename 1472 560 16 2048 800 busybox_old 1398 552 16 1966 7ae busybox_unstripped Signed-off-by: Denys Vlasenko --- libbb/appletlib.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libbb/appletlib.c b/libbb/appletlib.c index 14be33603..5c5d7eb95 100644 --- a/libbb/appletlib.c +++ b/libbb/appletlib.c @@ -726,9 +726,9 @@ int scripted_main(int argc UNUSED_PARAM, char **argv) int script = find_script_by_name(applet_name); if (script >= 0) # if ENABLE_SHELL_ASH - exit(ash_main(-script - 1, argv)); + return ash_main(-script - 1, argv); # elif ENABLE_SHELL_HUSH - exit(hush_main(-script - 1, argv)); + return hush_main(-script - 1, argv); # else return 1; # endif @@ -1005,10 +1005,10 @@ int scripted_main(int argc UNUSED_PARAM, char **argv) { # if ENABLE_SHELL_ASH int script = 0; - exit(ash_main(-script - 1, argv)); + return ash_main(-script - 1, argv); # elif ENABLE_SHELL_HUSH int script = 0; - exit(hush_main(-script - 1, argv)); + return hush_main(-script - 1, argv); # else return 1; # endif @@ -1094,7 +1094,7 @@ int main(int argc UNUSED_PARAM, char **argv) full_write2_str(bb_basename(argv[0])); full_write2_str(": no applets enabled\n"); - exit(127); + return 127; #else -- cgit v1.2.3