diff --git a/src/unix/tty.c b/src/unix/tty.c index 7cc5b714ed3..02164f9dce2 100644 --- a/src/unix/tty.c +++ b/src/unix/tty.c @@ -185,8 +185,13 @@ int uv_tty_set_mode(uv_tty_t* tty, uv_tty_mode_t mode) { int uv_tty_get_winsize(uv_tty_t* tty, int* width, int* height) { struct winsize ws; + int err; + + do + err = ioctl(uv__stream_fd(tty), TIOCGWINSZ, &ws); + while (err == -1 && errno == EINTR); - if (ioctl(uv__stream_fd(tty), TIOCGWINSZ, &ws)) + if (err == -1) return -errno; *width = ws.ws_col;