From 027a73a903af306449710ce12bc09e0e3550c6c9 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Thu, 4 Aug 2016 10:16:59 -0500 Subject: Make xopen() skip stdin/stdout/stderr, add xopen_stdio() if you want stdout, add xopenro() that takes one argument and understands "-" means stdin, and switch over lots of users. --- toys/posix/comm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'toys/posix/comm.c') diff --git a/toys/posix/comm.c b/toys/posix/comm.c index 6c726cf6..ded262f5 100644 --- a/toys/posix/comm.c +++ b/toys/posix/comm.c @@ -48,8 +48,7 @@ void comm_main(void) if (toys.optflags == 7) return; for (i = 0; i < 2; i++) { - file[i] = strcmp("-", toys.optargs[i]) - ? xopen(toys.optargs[i], O_RDONLY) : 0; + file[i] = xopenro(toys.optargs[i]); line[i] = get_line(file[i]); } -- cgit v1.2.3