aboutsummaryrefslogtreecommitdiff
path: root/toys/posix/xargs.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2015-09-29 05:09:46 -0500
committerRob Landley <rob@landley.net>2015-09-29 05:09:46 -0500
commit7d6af77804adc069a83e8566250f868a6cb9786e (patch)
tree92b6b57f55c41ab13164c1d448b3cdd1129703b4 /toys/posix/xargs.c
parent3b51a07e478d64a84e40b3a7c026b2f8566b194b (diff)
downloadtoybox-7d6af77804adc069a83e8566250f868a6cb9786e.tar.gz
Make defconfig build for nommu.
Adds XVFORK() macro, teaches xpopen_both() to call /proc/self/exe with NULL argv (and converts cpio -p to use that), adds TOYBOX_FORK guards to some unconverted commands.
Diffstat (limited to 'toys/posix/xargs.c')
-rw-r--r--toys/posix/xargs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/toys/posix/xargs.c b/toys/posix/xargs.c
index 50c42620..b4cb80a0 100644
--- a/toys/posix/xargs.c
+++ b/toys/posix/xargs.c
@@ -111,6 +111,7 @@ void xargs_main(void)
struct double_list *dlist = NULL, *dtemp;
int entries, bytes, done = 0, status;
char *data = NULL, **out;
+ pid_t pid;
if (!(toys.optflags & FLAG_0)) TT.delim = '\n';
@@ -168,8 +169,7 @@ void xargs_main(void)
for (dtemp = dlist; dtemp; dtemp = dtemp->next)
handle_entries(dtemp->data, out+entries);
- pid_t pid=xvfork();
- if (!pid) {
+ if (!(pid = XVFORK())) {
xclose(0);
open("/dev/null", O_RDONLY);
xexec(out);