aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2011-02-02 03:28:56 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2011-02-02 03:28:56 +0100
commitc71b469f5daceb717e31cc9ce46b0e058e2c57b6 (patch)
treeab428529615091f3d1759ad9fcd254f0cab46b19 /include
parent099e528919e2219772265e99ab8a43d188c1b8db (diff)
downloadbusybox-w32-c71b469f5daceb717e31cc9ce46b0e058e2c57b6.tar.gz
busybox-w32-c71b469f5daceb717e31cc9ce46b0e058e2c57b6.tar.bz2
busybox-w32-c71b469f5daceb717e31cc9ce46b0e058e2c57b6.zip
libbb: make BB_EXECVP/LP try to exec real binary if there's no /proc/self/exe
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'include')
-rw-r--r--include/libbb.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 182b47988..e69e27944 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -867,14 +867,16 @@ int exists_execable(const char *filename) FAST_FUNC;
867 * but it may exec busybox and call applet instead of searching PATH. 867 * but it may exec busybox and call applet instead of searching PATH.
868 */ 868 */
869#if ENABLE_FEATURE_PREFER_APPLETS 869#if ENABLE_FEATURE_PREFER_APPLETS
870int bb_execvp(const char *file, char *const argv[]) FAST_FUNC; 870int BB_EXECVP(const char *file, char *const argv[]) FAST_FUNC;
871#define BB_EXECVP(prog,cmd) bb_execvp(prog,cmd)
872#define BB_EXECLP(prog,cmd,...) \ 871#define BB_EXECLP(prog,cmd,...) \
873 execlp((find_applet_by_name(prog) >= 0) ? CONFIG_BUSYBOX_EXEC_PATH : prog, \ 872 do { \
874 cmd, __VA_ARGS__) 873 if (find_applet_by_name(prog) >= 0) \
874 execlp(bb_busybox_exec_path, cmd, __VA_ARGS__); \
875 execlp(prog, cmd, __VA_ARGS__); \
876 } while (0)
875#else 877#else
876#define BB_EXECVP(prog,cmd) execvp(prog,cmd) 878#define BB_EXECVP(prog,cmd) execvp(prog,cmd)
877#define BB_EXECLP(prog,cmd,...) execlp(prog,cmd, __VA_ARGS__) 879#define BB_EXECLP(prog,cmd,...) execlp(prog,cmd,__VA_ARGS__)
878#endif 880#endif
879int BB_EXECVP_or_die(char **argv) NORETURN FAST_FUNC; 881int BB_EXECVP_or_die(char **argv) NORETURN FAST_FUNC;
880 882