From c71b469f5daceb717e31cc9ce46b0e058e2c57b6 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 2 Feb 2011 03:28:56 +0100 Subject: libbb: make BB_EXECVP/LP try to exec real binary if there's no /proc/self/exe Signed-off-by: Denys Vlasenko --- include/libbb.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'include') 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; * but it may exec busybox and call applet instead of searching PATH. */ #if ENABLE_FEATURE_PREFER_APPLETS -int bb_execvp(const char *file, char *const argv[]) FAST_FUNC; -#define BB_EXECVP(prog,cmd) bb_execvp(prog,cmd) +int BB_EXECVP(const char *file, char *const argv[]) FAST_FUNC; #define BB_EXECLP(prog,cmd,...) \ - execlp((find_applet_by_name(prog) >= 0) ? CONFIG_BUSYBOX_EXEC_PATH : prog, \ - cmd, __VA_ARGS__) + do { \ + if (find_applet_by_name(prog) >= 0) \ + execlp(bb_busybox_exec_path, cmd, __VA_ARGS__); \ + execlp(prog, cmd, __VA_ARGS__); \ + } while (0) #else #define BB_EXECVP(prog,cmd) execvp(prog,cmd) -#define BB_EXECLP(prog,cmd,...) execlp(prog,cmd, __VA_ARGS__) +#define BB_EXECLP(prog,cmd,...) execlp(prog,cmd,__VA_ARGS__) #endif int BB_EXECVP_or_die(char **argv) NORETURN FAST_FUNC; -- cgit v1.2.3