fix error handling in ncurses resize code
This commit is contained in:
parent
95cc08a19e
commit
0b14f387d4
|
@ -80,7 +80,7 @@ void on_term_resize(int)
|
||||||
{
|
{
|
||||||
int fd = open("/dev/tty", O_RDWR);
|
int fd = open("/dev/tty", O_RDWR);
|
||||||
winsize ws;
|
winsize ws;
|
||||||
if (fd == 0 or ioctl(fd, TIOCGWINSZ, (void*)&ws) != 0)
|
if (fd == -1 or ioctl(fd, TIOCGWINSZ, (void*)&ws) != 0)
|
||||||
return;
|
return;
|
||||||
close(fd);
|
close(fd);
|
||||||
resizeterm(ws.ws_row, ws.ws_col);
|
resizeterm(ws.ws_row, ws.ws_col);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user