← Commit list

628f134fe

Denys Vlasenko
Denys Vlasenko
2014-11-17
SUCCESS Duration: 152s

Subject

exit with 127 if appled name wasn't found - it's more POSIXy

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

libbb/appletlib.c+4 -2
@@ -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
}