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/pending/getty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toys/pending/getty.c') diff --git a/toys/pending/getty.c b/toys/pending/getty.c index c7376288..25d04eaa 100644 --- a/toys/pending/getty.c +++ b/toys/pending/getty.c @@ -128,7 +128,7 @@ static void open_tty(void) if ((setsid() < 0) && (getpid() != getsid(0))) perror_exit("setsid"); xclose(0); - xopen(TT.tty_name, O_RDWR|O_NDELAY|O_CLOEXEC); + xopen_stdio(TT.tty_name, O_RDWR|O_NDELAY|O_CLOEXEC); fcntl(0, F_SETFL, fcntl(0, F_GETFL) & ~O_NONBLOCK); // Block read dup2(0, 1); dup2(0, 2); -- cgit v1.2.3