Kernel/PTYs - Fixed named ptys not being removed from list
authorJohn Hodge <[email protected]>
Sun, 8 Sep 2013 01:14:55 +0000 (09:14 +0800)
committerJohn Hodge <[email protected]>
Sun, 8 Sep 2013 01:14:55 +0000 (09:14 +0800)
KernelLand/Kernel/drv/pty.c

index f9f6262..d6619a5 100644 (file)
@@ -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);

UCC git Repository :: git.ucc.asn.au