aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGravatar Denis Vlasenko <vda.linux@googlemail.com>2007-02-03 02:17:41 +0000
committerGravatar Denis Vlasenko <vda.linux@googlemail.com>2007-02-03 02:17:41 +0000
commit4921b54f37125a58d5ea1a8aac886ae781517bc1 (patch)
treed8a989b6b3c29db835d3ec3084b908b6199d91dc /include
parent0aa84906936bd99ea8627a24b8ad2fdeedc7e928 (diff)
downloadbusybox-4921b54f37125a58d5ea1a8aac886ae781517bc1.tar.gz
busybox-4921b54f37125a58d5ea1a8aac886ae781517bc1.tar.bz2
Add BB_EXEC[LV]P() which encapsulate FEATURE_EXEC_PREFER_APPLETS
(patch from Gabriel L. Somlo <somlo@cmu.edu>)
Diffstat (limited to 'include')
-rw-r--r--include/libbb.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/libbb.h b/include/libbb.h
index ed1c41a02..85afdf20a 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -551,6 +551,16 @@ int execable_file(const char *name);
char *find_execable(const char *filename);
int exists_execable(const char *filename);
+#ifdef ENABLE_FEATURE_EXEC_PREFER_APPLETS
+#define BB_EXECVP(prog,cmd) \
+ execvp((find_applet_by_name(prog)) ? CONFIG_BUSYBOX_EXEC_PATH : prog, cmd)
+#define BB_EXECLP(prog,cmd,...) \
+ execlp((find_applet_by_name(prog)) ? CONFIG_BUSYBOX_EXEC_PATH : prog, cmd, __VA_ARGS__)
+#else
+#define BB_EXECVP(prog,cmd) execvp(prog,cmd)
+#define BB_EXECLP(prog,cmd,...) execvp(prog,cmd, __VA_ARGS__)
+#endif
+
USE_DESKTOP(long long) int uncompress(int fd_in, int fd_out);
int inflate(int in, int out);