X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FKernel%2Fvfs%2Fopen.c;fp=KernelLand%2FKernel%2Fvfs%2Fopen.c;h=68c9bd2e6b2d51f0d88acf4c9dcc69fe56daab62;hb=097d17ad093701091b0925aa7b13378cb9aed9df;hp=748d0f7e7a173189f4573479806db6102dda570b;hpb=8cf9dc88c488ba959a211f1ec653a366d16e1531;p=tpg%2Facess2.git 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;