aboutsummaryrefslogtreecommitdiff
path: root/libbb/appletlib.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2014-11-17 17:03:47 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2014-11-17 17:03:47 +0100
commit628f134fe7f1f868c60f8bd18645a626e9c5487f (patch)
treead0807a621e7edcb24325b4a016258ecdaae9c48 /libbb/appletlib.c
parentd3fabf89d7d38a436672ac2deea7904351b1b12a (diff)
downloadbusybox-w32-628f134fe7f1f868c60f8bd18645a626e9c5487f.tar.gz
busybox-w32-628f134fe7f1f868c60f8bd18645a626e9c5487f.tar.bz2
busybox-w32-628f134fe7f1f868c60f8bd18645a626e9c5487f.zip
exit with 127 if appled name wasn't found - it's more POSIXy
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb/appletlib.c')
-rw-r--r--libbb/appletlib.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c
index cb16e310f..54300bd87 100644
--- a/libbb/appletlib.c
+++ b/libbb/appletlib.c
@@ -733,7 +733,8 @@ static int busybox_main(char **argv)
733 /*bb_error_msg_and_die("applet not found"); - sucks in printf */ 733 /*bb_error_msg_and_die("applet not found"); - sucks in printf */
734 full_write2_str(applet_name); 734 full_write2_str(applet_name);
735 full_write2_str(": applet not found\n"); 735 full_write2_str(": applet not found\n");
736 xfunc_die(); 736 /* POSIX: "If a command is not found, the exit status shall be 127" */
737 exit(127);
737} 738}
738 739
739void FAST_FUNC run_applet_no_and_exit(int applet_no, char **argv) 740void FAST_FUNC run_applet_no_and_exit(int applet_no, char **argv)
@@ -838,6 +839,7 @@ int main(int argc UNUSED_PARAM, char **argv)
838 /*bb_error_msg_and_die("applet not found"); - sucks in printf */ 839 /*bb_error_msg_and_die("applet not found"); - sucks in printf */
839 full_write2_str(applet_name); 840 full_write2_str(applet_name);
840 full_write2_str(": applet not found\n"); 841 full_write2_str(": applet not found\n");
841 xfunc_die(); 842 /* POSIX: "If a command is not found, the exit status shall be 127" */
843 exit(127);
842#endif 844#endif
843} 845}