From 628f134fe7f1f868c60f8bd18645a626e9c5487f Mon Sep 17 00:00:00 2001
From: Denys Vlasenko <vda.linux@googlemail.com>
Date: Mon, 17 Nov 2014 17:03:47 +0100
Subject: exit with 127 if appled name wasn't found - it's more POSIXy

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
---
 libbb/appletlib.c | 6 ++++--
 1 file 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)
 	/*bb_error_msg_and_die("applet not found"); - sucks in printf */
 	full_write2_str(applet_name);
 	full_write2_str(": applet not found\n");
-	xfunc_die();
+	/* POSIX: "If a command is not found, the exit status shall be 127" */
+	exit(127);
 }
 
 void FAST_FUNC run_applet_no_and_exit(int applet_no, char **argv)
@@ -838,6 +839,7 @@ int main(int argc UNUSED_PARAM, char **argv)
 	/*bb_error_msg_and_die("applet not found"); - sucks in printf */
 	full_write2_str(applet_name);
 	full_write2_str(": applet not found\n");
-	xfunc_die();
+	/* POSIX: "If a command is not found, the exit status shall be 127" */
+	exit(127);
 #endif
 }
-- 
cgit v1.2.3