diff --git a/picocom.c b/picocom.c index 2eb964f..12d9c1a 100644 --- a/picocom.c +++ b/picocom.c @@ -679,6 +679,8 @@ cleanup (int drain, int noreset, int hup) comments in term.c/term_exitfunc() for more. */ flock(tty_fd, LOCK_UN); #endif + close(tty_fd); + tty_fd = -1; } } diff --git a/term.c b/term.c index 93b99f9..76b38cc 100644 --- a/term.c +++ b/term.c @@ -421,6 +421,7 @@ term_exitfunc (void) set). */ flock(term.fd[i], LOCK_UN); #endif + close(term.fd[i]); term.fd[i] = -1; } } while (0);