From 1b9498b875b3a0c7f978d6bc227904216db04456 Mon Sep 17 00:00:00 2001 From: dfr Date: Tue, 28 Mar 1995 22:20:19 +0000 Subject: [PATCH] Use __tty_fileno instead of STDERR_FILENO when detecting window size changes Reviewed by: Bob Willcox --- lib/libcurses/setterm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libcurses/setterm.c b/lib/libcurses/setterm.c index ddb5871e4a80..2c2e36ef563e 100644 --- a/lib/libcurses/setterm.c +++ b/lib/libcurses/setterm.c @@ -109,7 +109,7 @@ setterm(type) #endif /* Try TIOCGWINSZ, and, if it fails, the termcap entry. */ - if (ioctl(STDERR_FILENO, TIOCGWINSZ, &win) != -1 && + if (ioctl(__tty_fileno, TIOCGWINSZ, &win) != -1 && win.ws_row != 0 && win.ws_col != 0) { LINES = win.ws_row; COLS = win.ws_col;