PATCH: replacing exec*p with BB_EXEC*P
Denis Vlasenko
vda.linux at googlemail.com
Sat Feb 3 16:08:05 PST 2007
On Sunday 04 February 2007 00:58, Gabriel L. Somlo wrote:
> Denis & All,
>
> The first part of this patch fixes BB_EXECLP in libbb.h, (it
> accidentally calls execvp instead of execlp).
Thanks! Consider this already fixed.
> The rest replaces execlp and execvp calls with BB_EXECLP and
> BB_EXECVP, respectively (except in the shells, where we use
> STANDALONE_SHELL to accomplish this).
>
> Once this is in, we should be able to remove hardcoded paths from
> anywhere else they might still be used.
>
> Cheers,
> Gabriel
>
> diff -NarU5 busybox-svn-17746.orig/include/libbb.h busybox-svn-17746/include/libbb.h
> --- busybox-svn-17746.orig/include/libbb.h 2007-02-03 18:17:57.000000000 -0500
> +++ busybox-svn-17746/include/libbb.h 2007-02-03 18:36:09.000000000 -0500
> @@ -559,11 +559,11 @@
> 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
Twenty one callsites. Maybe BB_EXECVP should call bb_execvp()
(which should be a function) to save space?
> #define BB_EXECVP(prog,cmd) execvp(prog,cmd)
> -#define BB_EXECLP(prog,cmd,...) execvp(prog,cmd, __VA_ARGS__)
> +#define BB_EXECLP(prog,cmd,...) execlp(prog,cmd, __VA_ARGS__)
It's probably too messy to make BB_EXECLP a function because of varargs...
Otherwise looks ok.
--
vda
More information about the busybox
mailing list