aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
Diffstat (limited to 'libbb')
-rw-r--r--libbb/xfuncs.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/libbb/xfuncs.c b/libbb/xfuncs.c
index 601ff3f7e..3cbb0d3eb 100644
--- a/libbb/xfuncs.c
+++ b/libbb/xfuncs.c
@@ -184,17 +184,13 @@ pid_t spawn(char **argv)
184 /* Why static? */ 184 /* Why static? */
185 static int failed; 185 static int failed;
186 pid_t pid; 186 pid_t pid;
187 const char *prog;
188 187
189 // Be nice to nommu machines. 188 // Be nice to nommu machines.
190 failed = 0; 189 failed = 0;
191 pid = vfork(); 190 pid = vfork();
192 if (pid < 0) return pid; 191 if (pid < 0) return pid;
193 if (!pid) { 192 if (!pid) {
194 prog = argv[0]; 193 BB_EXECVP(argv[0], argv);
195 if (ENABLE_FEATURE_EXEC_PREFER_APPLETS && find_applet_by_name(prog))
196 prog = CONFIG_BUSYBOX_EXEC_PATH;
197 execvp(prog, argv);
198 194
199 // We're sharing a stack with blocked parent, let parent know we failed 195 // We're sharing a stack with blocked parent, let parent know we failed
200 // and then exit to unblock parent (but don't run atexit() stuff, which 196 // and then exit to unblock parent (but don't run atexit() stuff, which