Kernel/VFS - Fixed bug with setting flags on FD0
authorJohn Hodge <[email protected]>
Thu, 16 May 2013 06:08:46 +0000 (14:08 +0800)
committerJohn Hodge <[email protected]>
Thu, 16 May 2013 06:08:46 +0000 (14:08 +0800)
KernelLand/Kernel/vfs/open.c

index 748d0f7..68c9bd2 100644 (file)
@@ -810,7 +810,10 @@ int VFS_DuplicateFD(int SrcFD, int DstFD)
 int VFS_SetFDFlags(int FD, int Mask, int Value)
 {
        tVFS_Handle     *h = VFS_GetHandle(FD);
-       if(!FD) return -1;
+       if(!h) {
+               errno = EBADF;
+               return -1;
+       }
         int    ret = h->Mode;
        
        Value &= Mask;

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