summaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorDenys Vlasenko2021-09-28 17:40:59 +0200
committerDenys Vlasenko2021-09-28 17:40:59 +0200
commit03ed86b39e887b2f4031961673fddd88fdeb493e (patch)
tree236ac329fa8afcb26698889b659cfe2fb4a09375 /libbb
parent1be73dd9ad6d2cf6747934374c1d58bd9bc211b4 (diff)
downloadbusybox-03ed86b39e887b2f4031961673fddd88fdeb493e.zip
busybox-03ed86b39e887b2f4031961673fddd88fdeb493e.tar.gz
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>
Diffstat (limited to 'libbb')
-rw-r--r--libbb/appletlib.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c
index 14be336..5c5d7eb 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