Don't tcsetattr() ptmx in patty_kiss_tnc_destroy()
Avoid tcsetattr() on a ptmx in patty_kiss_tnc_destroy(), as the old attributes are not saved when opening a Unix98 PTY master
This commit is contained in:
parent
1f4ffc98ac
commit
671d4ef337
1 changed files with 3 additions and 1 deletions
|
@ -144,7 +144,9 @@ int patty_kiss_tnc_fd(patty_kiss_tnc *tnc) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void patty_kiss_tnc_destroy(patty_kiss_tnc *tnc) {
|
void patty_kiss_tnc_destroy(patty_kiss_tnc *tnc) {
|
||||||
(void)tcsetattr(tnc->fd, TCSANOW, &tnc->attrs_old);
|
if (isatty(tnc->fd) && ptsname(tnc->fd) == NULL) {
|
||||||
|
(void)tcsetattr(tnc->fd, TCSANOW, &tnc->attrs_old);
|
||||||
|
}
|
||||||
|
|
||||||
if (tnc->opts & TNC_CLOSE_ON_DESTROY) {
|
if (tnc->opts & TNC_CLOSE_ON_DESTROY) {
|
||||||
close(tnc->fd);
|
close(tnc->fd);
|
||||||
|
|
Loading…
Add table
Reference in a new issue