aboutsummaryrefslogtreecommitdiff
path: root/toys/other/oneit.c
diff options
context:
space:
mode:
Diffstat (limited to 'toys/other/oneit.c')
-rw-r--r--toys/other/oneit.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/toys/other/oneit.c b/toys/other/oneit.c
index 0e95a104..9be67c05 100644
--- a/toys/other/oneit.c
+++ b/toys/other/oneit.c
@@ -68,11 +68,11 @@ void oneit_main(void)
for (i = 0; i<ARRAY_LEN(pipes); i++) xsignal(pipes[i], oneit_signaled);
if (toys.optflags & FLAG_3) {
- // Ensure next available filehandle is #3
- while (open("/", 0) < 3);
+ // Ensure next available filehandles are #3 and #4
+ while (xopen_stdio("/", 0) < 3);
close(3);
close(4);
- if (pipe(pipes)) perror_exit("pipe");
+ xpipe(pipes);
fcntl(4, F_SETFD, FD_CLOEXEC);
}