Close tty_fd in master on fork() rather than on close()

This commit is contained in:
Kovid Goyal 2022-07-08 15:39:23 +05:30
parent 8998970adc
commit 6a101c51d2
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -463,6 +463,9 @@ def fork(self, free_non_child_resources: Callable[[], None]) -> None:
if self.pid > 0:
# master process
os.close(w)
if self.tty_fd > -1:
os.close(self.tty_fd)
self.tty_fd = -1
if self.stdin > -1:
os.close(self.stdin)
self.stdin = -1