From 4577605121fa441e5a28c32ce2c33be4c48df89b Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sun, 14 Jan 2018 23:15:01 -0600 Subject: Switch xgettty() -> tty_fd() (returning -1 instead of erroring out if none). --- lib/interestingtimes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/interestingtimes.c') diff --git a/lib/interestingtimes.c b/lib/interestingtimes.c index f028f5e9..073a67dd 100644 --- a/lib/interestingtimes.c +++ b/lib/interestingtimes.c @@ -5,13 +5,13 @@ #include "toys.h" -int xgettty(void) +int tty_fd(void) { int i, j; for (i = 0; i<3; i++) if (isatty(j = (i+1)%3)) return j; - return xopen("/dev/tty", O_RDWR); + return notstdio(open("/dev/tty", O_RDWR)); } // Quick and dirty query size of terminal, doesn't do ANSI probe fallback. -- cgit v1.2.3