mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 20:15:17 +00:00
Kernel: Process should release its TTY immediately on exit
Don't wait for someone to wait() on a dead process before releasing its TTY object. This fixes the child process death detection used by the Terminal application, which relies on getting an EOF on the master PTY in order to know it's time to wait() on the child process. :^)
This commit is contained in:
parent
bbc2f5205f
commit
07806d1273
Notes:
sideshowbarker
2024-07-19 11:17:48 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/07806d12732
1 changed files with 6 additions and 0 deletions
|
@ -2272,6 +2272,12 @@ void Process::finalize()
|
|||
|
||||
void Process::die()
|
||||
{
|
||||
// Let go of the TTY, otherwise a slave PTY may keep the master PTY from
|
||||
// getting an EOF when the last process using the slave PTY dies.
|
||||
// If the master PTY owner relies on an EOF to know when to wait() on a
|
||||
// slave owner, we have to allow the PTY pair to be torn down.
|
||||
m_tty = nullptr;
|
||||
|
||||
if (m_tracer)
|
||||
m_tracer->set_dead();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue