projects
/
platform
/
upstream
/
toybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
360d57f
)
Second attempt at one way xpopen().
author
Rob Landley
<rob@landley.net>
Mon, 15 Sep 2014 00:54:19 +0000
(19:54 -0500)
committer
Rob Landley
<rob@landley.net>
Mon, 15 Sep 2014 00:54:19 +0000
(19:54 -0500)
lib/xwrap.c
patch
|
blob
|
history
diff --git
a/lib/xwrap.c
b/lib/xwrap.c
index
64b183f
..
341aac3
100644
(file)
--- a/
lib/xwrap.c
+++ b/
lib/xwrap.c
@@
-215,12
+215,14
@@
int xpclose_both(pid_t pid, int *pipes)
// Wrapper to xpopen with a pipe for just one of stdin/stdout
pid_t xpopen(char **argv, int *pipe, int stdout)
{
- int pipes[2];
+ int pipes[2]
, pid
;
- pipe[!stdout] = -1;
- pipe[!!stdout] = 0;
+ pipes[!stdout] = -1;
+ pipes[!!stdout] = 0;
+ pid = xpopen_both(argv, pipes);
+ *pipe = pid ? pipes[!!stdout] : -1;
- return
xpopen_both(argv, pipes)
;
+ return
pid
;
}
int xpclose(pid_t pid, int pipe)