PATCH: replacing exec*p with BB_EXEC*P
Gabriel L. Somlo
somlo at cmu.edu
Mon Feb 5 13:13:48 UTC 2007
On Mon, Feb 05, 2007 at 09:49:00AM +0100, Bernhard Fischer wrote:
> On Mon, Feb 05, 2007 at 07:20:54AM +0100, Tito wrote:
> >On Monday 05 February 2007 00:23, Gabriel L. Somlo wrote:
> >> + BB_EXECVP(*argv, argv);
> >> bb_perror_msg_and_die("cannot execute %s", *argv);
> >
> >Hi,
> >shouldn't the bb_perror_msg_and_die("cannot execute %s", *argv)
> >be moved inside BB_EXECVP(*argv, argv); ?
> >This would probably save some space.
>
> seconded :)
I too noticed that a lot of the code surrounding execvp/BB_EXECVP
looks similar in a lot of the places it happens. However, BB_EXECVP
was meant as strictly a drop-in replacement for the execvp function
call. Maybe what we want to do is find a way to replace a lot of the
boilerplate code with a call to spawn() (in libbb/xfuncs.c) instead...
Cheers,
Gabriel
>
> Also, i'd add a bb_msg_exec_failed
> and fixup svngrep -ri "exec.*%s" * to use that msg instead of growing
> a dozend of separate messages for this very same error, but maybe that's
> just me :P
>
More information about the busybox
mailing list