summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2021-09-28 17:40:59 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2021-09-28 17:40:59 +0200
commit03ed86b39e887b2f4031961673fddd88fdeb493e (patch)
tree236ac329fa8afcb26698889b659cfe2fb4a09375
parent1be73dd9ad6d2cf6747934374c1d58bd9bc211b4 (diff)
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 <vda.linux@googlemail.com>
-rw-r--r--libbb/appletlib.c10
1 files 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