unix,tty: don't drain when setting the TTY mode (#4945)
This avoids a blocking syscall (essentially a write)–and thus potential deadlock–in the asynchronous IO path.
This commit is contained in:
parent
651f2fc161
commit
b84a067e0f
@ -333,8 +333,8 @@ int uv_tty_set_mode(uv_tty_t* tty, uv_tty_mode_t mode) {
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
/* Apply changes after draining */
|
||||
rc = uv__tcsetattr(fd, TCSADRAIN, &tmp);
|
||||
/* Apply changes now, to avoid blocking. */
|
||||
rc = uv__tcsetattr(fd, TCSANOW, &tmp);
|
||||
if (rc == 0)
|
||||
tty->mode = mode;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user