Let the slave PTY keep the master PTY alive.

This ownership model is a bit confusing. There's a retain cycle between
MasterPTY and SlavePTY, but it's broken when the SlavePTY is closed, meaning
that there are no more FileDescriptors referring to it.
This commit is contained in:
Andreas Kling 2019-01-30 19:05:59 +01:00
commit 2b4374d08e
Notes: sideshowbarker 2024-07-19 15:55:12 +09:00
4 changed files with 7 additions and 4 deletions

View file

@ -87,6 +87,7 @@ int main(int, char**)
int nfds = select(max(ptm_fd, event_fd) + 1, &rfds, nullptr, nullptr, nullptr);
if (nfds < 0) {
dbgprintf("Terminal(%u) select() failed :( errno=%d\n", getpid(), errno);
return 1;
}
if (FD_ISSET(ptm_fd, &rfds)) {