diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-02-03 02:17:41 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-02-03 02:17:41 +0000 |
commit | 4921b54f37125a58d5ea1a8aac886ae781517bc1 (patch) | |
tree | d8a989b6b3c29db835d3ec3084b908b6199d91dc /libbb | |
parent | 0aa84906936bd99ea8627a24b8ad2fdeedc7e928 (diff) | |
download | busybox-w32-4921b54f37125a58d5ea1a8aac886ae781517bc1.tar.gz busybox-w32-4921b54f37125a58d5ea1a8aac886ae781517bc1.tar.bz2 busybox-w32-4921b54f37125a58d5ea1a8aac886ae781517bc1.zip |
Add BB_EXEC[LV]P() which encapsulate FEATURE_EXEC_PREFER_APPLETS
(patch from Gabriel L. Somlo <somlo@cmu.edu>)
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/xfuncs.c | 6 |
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 |