*/
tVFS_Handle *VFS_GetHandle(int FD)
{
+ tVFS_Handle *h;
+
if(FD < 0) return NULL;
if(FD & VFS_KERNEL_FLAG) {
FD &= (VFS_KERNEL_FLAG - 1);
if(FD >= MAX_KERNEL_FILES) return NULL;
- return &gaKernelHandles[ FD ];
+ h = &gaKernelHandles[ FD ];
} else {
if(FD >= CFGINT(CFG_VFS_MAXFILES)) return NULL;
- return &gaUserHandles[ FD ];
+ h = &gaUserHandles[ FD ];
}
+
+ if(h->Node == NULL) return NULL;
+ return h;
}
if(fp == -1) continue;\r
// Get File Stats\r
finfo(fp, &info, 0);\r
- close(fp);\r
\r
//Print Mode\r
//#if 0\r
if(acl.perms & 1) modeStr[8] = 'x'; else modeStr[8] = '-';\r
write(_stdout, 10, modeStr);\r
//#endif\r
+ close(fp);\r
\r
// Colour Code\r
if(info.flags & FILEFLAG_DIRECTORY) // Directory: Green\r