aboutsummaryrefslogtreecommitdiff
path: root/deps/uv/src/unix/tty.c
diff options
context:
space:
mode:
Diffstat (limited to 'deps/uv/src/unix/tty.c')
-rw-r--r--deps/uv/src/unix/tty.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/deps/uv/src/unix/tty.c b/deps/uv/src/unix/tty.c
index a2b76add67..91baa6ac8c 100644
--- a/deps/uv/src/unix/tty.c
+++ b/deps/uv/src/unix/tty.c
@@ -37,8 +37,11 @@ int uv_tty_init(uv_loop_t* loop, uv_tty_t* tty, int fd, int readable) {
uv__stream_init(loop, (uv_stream_t*)tty, UV_TTY);
#if defined(__APPLE__)
- if (uv__stream_try_select((uv_stream_t*) tty, &fd))
- return -1;
+ {
+ int err = uv__stream_try_select((uv_stream_t*) tty, &fd);
+ if (err)
+ return err;
+ }
#endif /* defined(__APPLE__) */
if (readable) {
@@ -102,18 +105,15 @@ int uv_tty_set_mode(uv_tty_t* tty, int mode) {
}
fatal:
- uv__set_sys_error(tty->loop, errno);
- return -1;
+ return -errno;
}
int uv_tty_get_winsize(uv_tty_t* tty, int* width, int* height) {
struct winsize ws;
- if (ioctl(uv__stream_fd(tty), TIOCGWINSZ, &ws) < 0) {
- uv__set_sys_error(tty->loop, errno);
- return -1;
- }
+ if (ioctl(uv__stream_fd(tty), TIOCGWINSZ, &ws))
+ return -errno;
*width = ws.ws_col;
*height = ws.ws_row;