Kernel/PTYs - Fixed server-end of user closing prematurely
authorJohn Hodge <[email protected]>
Sat, 27 Jul 2013 10:26:15 +0000 (18:26 +0800)
committerJohn Hodge <[email protected]>
Sat, 27 Jul 2013 10:26:15 +0000 (18:26 +0800)
KernelLand/Kernel/drv/pty.c

index 8f4302d..3b59c7e 100644 (file)
@@ -519,8 +519,11 @@ tVFS_Node *PTY_FindDir(tVFS_Node *Node, const char *Name, Uint Flags)
                }
                RWLock_Release(&glPTY_NamedPTYs);
        }
-       if( ret )
-               return (isServer ? &ret->ServerNode : &ret->ClientNode);
+       if( ret ) {
+               tVFS_Node       *retnode = (isServer ? &ret->ServerNode : &ret->ClientNode);
+               retnode->ReferenceCount ++;
+               return retnode;
+       }
        else
                return NULL;
 }

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