aboutsummaryrefslogtreecommitdiff
path: root/toys
diff options
context:
space:
mode:
Diffstat (limited to 'toys')
-rw-r--r--toys/other/watch.c4
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;
}