From 1f4ae01b1d35d42048827711891251c49d940160 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Fri, 25 Sep 2009 14:45:18 +0800 Subject: [PATCH] Fixed bug in VFS_ReadDir and added full debug --- Kernel/vfs/dir.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Kernel/vfs/dir.c b/Kernel/vfs/dir.c index cb2bd8db..043d49cc 100644 --- a/Kernel/vfs/dir.c +++ b/Kernel/vfs/dir.c @@ -143,14 +143,18 @@ int VFS_ReadDir(int FD, char *Dest) ENTER("ph pDest", h, Dest); - if(h) return -1; - - if(h->Node->ReadDir == NULL) return 0; + if(!h || h->Node->ReadDir == NULL) { + LEAVE('i', 0); + return 0; + } tmp = h->Node->ReadDir(h->Node, h->Position); LOG("tmp = '%s'", tmp); - if(!tmp) return 0; + if(!tmp) { + LEAVE('i', 0); + return 0; + } h->Position ++; @@ -158,5 +162,6 @@ int VFS_ReadDir(int FD, char *Dest) if(IsHeap(tmp)) free(tmp); + LEAVE('i', 1); return 1; } -- 2.20.1