aboutsummaryrefslogtreecommitdiff
path: root/toys/posix
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2014-09-14 12:29:44 -0500
committerRob Landley <rob@landley.net>2014-09-14 12:29:44 -0500
commit360d57f843f5435a75270e54583430dcb8f62546 (patch)
tree2e043033414a0cb03b6eb86b3b662f7ca9571788 /toys/posix
parente1366f02fea3cb035cc4ed0b59d12f1962b6ebfd (diff)
downloadtoybox-360d57f843f5435a75270e54583430dcb8f62546.tar.gz
Split xpopen() into xpopen_both(), xpopen(), and xrun() depending on whether we want to redirect both, one, or neither of stdin/stdout.
Diffstat (limited to 'toys/posix')
-rw-r--r--toys/posix/cp.c3
-rw-r--r--toys/posix/find.c2
2 files changed, 2 insertions, 3 deletions
diff --git a/toys/posix/cp.c b/toys/posix/cp.c
index d79819b2..d73b7229 100644
--- a/toys/posix/cp.c
+++ b/toys/posix/cp.c
@@ -341,8 +341,7 @@ static int install_node(struct dirtree *try)
// No -r so always one level deep, so destname as set by cp_node() is correct
if (toys.optflags & FLAG_s)
- if (xpclose(xpopen((char *[]){"strip", "-p", TT.destname, 0}, 0), 0))
- toys.exitval = 1;
+ if (xrun((char *[]){"strip", "-p", TT.destname, 0})) toys.exitval = 1;
return 0;
}
diff --git a/toys/posix/find.c b/toys/posix/find.c
index b74cb88e..9f679a02 100644
--- a/toys/posix/find.c
+++ b/toys/posix/find.c
@@ -102,7 +102,7 @@ static int flush_exec(struct dirtree *new, struct exec_range *aa)
newargs[pos+rest] = 0;
}
- rc = xpclose(xpopen(newargs, 0), 0);
+ rc = xrun(newargs);
llist_traverse(*dl, llist_free_double);
*dl = 0;