terminal-util: Protect errno in termios_reset()
This commit is contained in:
committed by
Daan De Meyer
parent
7d11e8bed7
commit
bfdc389ea7
@@ -2114,6 +2114,8 @@ static bool termios_is_null(const struct termios *t) {
|
||||
void termios_reset(const TermiosResetContext *c) {
|
||||
assert(c);
|
||||
|
||||
PROTECT_ERRNO;
|
||||
|
||||
if (c->fd && *c->fd >= 0 && !termios_is_null(c->termios))
|
||||
(void) tcsetattr(*c->fd, TCSANOW, c->termios);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user