From 975960e20fd4371caccff9949d8594419624e061 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sun, 10 Mar 2019 14:30:18 -0500 Subject: Make multiple sendfile variants, and teach xpopen_both() to use existing stdin/stdout filehandles. --- toys/other/watch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'toys') 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; } -- cgit v1.2.3