From: John Hodge Date: Thu, 16 May 2013 06:08:46 +0000 (+0800) Subject: Kernel/VFS - Fixed bug with setting flags on FD0 X-Git-Tag: rel0.15~473 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=097d17ad093701091b0925aa7b13378cb9aed9df;p=tpg%2Facess2.git Kernel/VFS - Fixed bug with setting flags on FD0 --- diff --git a/KernelLand/Kernel/vfs/open.c b/KernelLand/Kernel/vfs/open.c index 748d0f7e..68c9bd2e 100644 --- a/KernelLand/Kernel/vfs/open.c +++ b/KernelLand/Kernel/vfs/open.c @@ -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;