Skip to content

Commit

Permalink
deps: fix libuv build on SmartOS
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Gilli committed Feb 17, 2015
1 parent 9575348 commit 8ba154b
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion deps/uv/src/unix/tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,22 @@ int uv_tty_init(uv_loop_t* loop, uv_tty_t* tty, int fd, int readable) {
return 0;
}

static void uv__tty_make_raw(struct termios* tio) {
#ifdef __sun
/*
* This implementation of cfmakeraw for Solaris and derivatives is taken from
* http://www.perkin.org.uk/posts/solaris-portability-cfmakeraw.html.
*/
tio->c_iflag &= ~(IMAXBEL | IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR |
IGNCR | ICRNL | IXON);
tio->c_oflag &= ~OPOST;
tio->c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN);
tio->c_cflag &= ~(CSIZE | PARENB);
tio->c_cflag |= CS8;
#else
cfmakeraw(tio);
#endif /* #ifdef __sun */
}

int uv_tty_set_mode(uv_tty_t* tty, uv_tty_mode_t mode) {
struct termios tmp;
Expand Down Expand Up @@ -138,7 +154,7 @@ int uv_tty_set_mode(uv_tty_t* tty, uv_tty_mode_t mode) {
tmp.c_cc[VTIME] = 0;
break;
case UV_TTY_MODE_IO:
cfmakeraw(&tmp);
uv__tty_make_raw(&tmp);
break;
}

Expand Down

0 comments on commit 8ba154b

Please sign in to comment.