1
0
mirror of https://github.com/UzixLS/picocom.git synced 2025-07-19 07:21:18 +03:00

Close tty_fd after resetting and before exiting

This commit is contained in:
Nick Patavalis
2018-01-20 16:45:48 +02:00
parent 2a120ef1df
commit 8eab62945d
2 changed files with 3 additions and 0 deletions

View File

@ -679,6 +679,8 @@ cleanup (int drain, int noreset, int hup)
comments in term.c/term_exitfunc() for more. */ comments in term.c/term_exitfunc() for more. */
flock(tty_fd, LOCK_UN); flock(tty_fd, LOCK_UN);
#endif #endif
close(tty_fd);
tty_fd = -1;
} }
} }

1
term.c
View File

@ -421,6 +421,7 @@ term_exitfunc (void)
set). */ set). */
flock(term.fd[i], LOCK_UN); flock(term.fd[i], LOCK_UN);
#endif #endif
close(term.fd[i]);
term.fd[i] = -1; term.fd[i] = -1;
} }
} while (0); } while (0);