fix error handling in ncurses resize code

This commit is contained in:
Maxime Coste 2012-11-20 18:55:44 +01:00
parent 95cc08a19e
commit 0b14f387d4

View File

@ -80,7 +80,7 @@ void on_term_resize(int)
{
int fd = open("/dev/tty", O_RDWR);
winsize ws;
if (fd == 0 or ioctl(fd, TIOCGWINSZ, (void*)&ws) != 0)
if (fd == -1 or ioctl(fd, TIOCGWINSZ, (void*)&ws) != 0)
return;
close(fd);
resizeterm(ws.ws_row, ws.ws_col);