aboutsummaryrefslogtreecommitdiff
path: root/libbb/appletlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbb/appletlib.c')
-rw-r--r--libbb/appletlib.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c
index 24253cf27..871f78db3 100644
--- a/libbb/appletlib.c
+++ b/libbb/appletlib.c
@@ -771,7 +771,9 @@ void FAST_FUNC run_applet_no_and_exit(int applet_no, char **argv)
}
if (ENABLE_FEATURE_SUID)
check_suid(applet_no);
- exit(applet_main[applet_no](argc, argv));
+ xfunc_error_retval = applet_main[applet_no](argc, argv);
+ /* Note: applet_main() may also not return (die on a xfunc or such) */
+ xfunc_die();
}
void FAST_FUNC run_applet_and_exit(const char *name, char **argv)