X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FKernel%2Fvfs%2Fhandle.c;h=cb4fae1200f936cac5eb0210546c63c7c8175211;hb=2e9775068c0df5c846260fa3b5265746f404f2f3;hp=88877aba00bd91cc5344acd49766291fa08ace61;hpb=6804038d728db78026b05507944bd1eb6587e22b;p=tpg%2Facess2.git diff --git a/KernelLand/Kernel/vfs/handle.c b/KernelLand/Kernel/vfs/handle.c index 88877aba..cb4fae12 100644 --- a/KernelLand/Kernel/vfs/handle.c +++ b/KernelLand/Kernel/vfs/handle.c @@ -19,6 +19,7 @@ #if 0 tVFS_Handle *VFS_GetHandle(int FD); #endif +inline void _ReferenceNode(tVFS_Node *Node); int VFS_AllocHandle(int FD, tVFS_Node *Node, int Mode); // === GLOBALS === @@ -195,7 +196,14 @@ void *VFS_SaveHandles(int NumFDs, int *FDs) tVFS_Handle *h; if( FDs == NULL ) h = &gaUserHandles[i]; - else { + else if( FDs[i] == -1 ) + { + Log_Warning("VFS", "VFS_SaveHandles - Slot %i error FD (-1), ignorning", i); + memset(&ret[i], 0, sizeof(tVFS_Handle)); + continue ; + } + else + { h = VFS_GetHandle(FDs[i] & (VFS_KERNEL_FLAG - 1)); if(!h) { Log_Warning("VFS", "VFS_SaveHandles - Invalid FD %i",