From: John Hodge Date: Fri, 25 Sep 2009 06:45:18 +0000 (+0800) Subject: Fixed bug in VFS_ReadDir and added full debug X-Git-Tag: rel0.06~511 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=1f4ae01b1d35d42048827711891251c49d940160;p=tpg%2Facess2.git Fixed bug in VFS_ReadDir and added full debug --- 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; }