From 37bd273f862128a2dd8a9a4c34c15dbbd6dc48ba Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sun, 8 Sep 2013 09:14:55 +0800 Subject: [PATCH] Kernel/PTYs - Fixed named ptys not being removed from list --- KernelLand/Kernel/drv/pty.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/KernelLand/Kernel/drv/pty.c b/KernelLand/Kernel/drv/pty.c index f9f62629..d6619a55 100644 --- a/KernelLand/Kernel/drv/pty.c +++ b/KernelLand/Kernel/drv/pty.c @@ -683,7 +683,7 @@ void PTY_CloseServer(tVFS_Node *Node) // Locate on list and remove tPTY **prev_np; - if( pty->NumericName == 0 ) { + if( pty->NumericName == -1 ) { RWLock_AcquireWrite(&glPTY_NamedPTYs); prev_np = &gpPTY_FirstNamedPTY; } @@ -705,7 +705,7 @@ void PTY_CloseServer(tVFS_Node *Node) } // Clean up lock - if( pty->NumericName == 0 ) { + if( pty->NumericName == -1 ) { RWLock_Release(&glPTY_NamedPTYs); giPTY_NamedCount --; } @@ -714,6 +714,8 @@ void PTY_CloseServer(tVFS_Node *Node) giPTY_NumCount --; } + // TODO: Send SIGHUP to controly PGID? + // If there are no open children, we can safely free this PTY if( pty->ClientNode.ReferenceCount == 0 ) { free(Node); -- 2.20.1