From 733cd5c013a1a67eca03b158a257e0fb18b9545e Mon Sep 17 00:00:00 2001 From: John Hodge Date: Mon, 22 Jul 2013 20:10:18 +0800 Subject: [PATCH] Kernel/VFS - Added debug for IOCtl failing --- KernelLand/Kernel/vfs/io.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/KernelLand/Kernel/vfs/io.c b/KernelLand/Kernel/vfs/io.c index 4bd26fda..271e920d 100644 --- a/KernelLand/Kernel/vfs/io.c +++ b/KernelLand/Kernel/vfs/io.c @@ -234,9 +234,17 @@ int VFS_IOCtl(int FD, int ID, void *Buffer) tVFS_Handle *h; h = VFS_GetHandle(FD); - if(!h) return -1; + if(!h) { + LOG("FD%i is invalid", FD); + errno = EINVAL; + return -1; + } - if(!h->Node->Type || !h->Node->Type->IOCtl) return -1; + if(!h->Node->Type || !h->Node->Type->IOCtl) { + LOG("FD%i does not have an IOCtl method"); + errno = EINVAL; + return -1; + } return h->Node->Type->IOCtl(h->Node, ID, Buffer); } -- 2.20.1