diff options
author | Rob Landley <rob@landley.net> | 2019-03-10 14:30:18 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2019-03-10 14:30:18 -0500 |
commit | 975960e20fd4371caccff9949d8594419624e061 (patch) | |
tree | 7f18b9a89f6ec1d209d9ed1c4006c8cbab511e45 /toys | |
parent | d5c1fe2ae383de59bd796c6a593ffea519310228 (diff) | |
download | toybox-975960e20fd4371caccff9949d8594419624e061.tar.gz |
Make multiple sendfile variants, and teach xpopen_both() to use existing
stdin/stdout filehandles.
Diffstat (limited to 'toys')
-rw-r--r-- | toys/other/watch.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/toys/other/watch.c b/toys/other/watch.c index 0a21cccc..fa5e71c5 100644 --- a/toys/other/watch.c +++ b/toys/other/watch.c @@ -125,8 +125,8 @@ void watch_main(void) if (fds[1]>0) close(fds[1]); // Spawn child process - memset(fds, 0, sizeof(fds)); - TT.pid = xpopen_both((toys.optflags&FLAG_x) ? toys.optargs : cmdv, fds); + fds[0] = fds[1] = -1; + TT.pid = xpopen_both(FLAG(x) ? toys.optargs : cmdv, fds); pfd[1].fd = fds[1]; active = 1; } |