mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 19:12:43 +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
					
				
					 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
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling