From: John Hodge Date: Fri, 25 Sep 2009 12:22:17 +0000 (+0800) Subject: Added support for skipping to VFS_ReadDir X-Git-Tag: rel0.06~506 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=220826af27a1f78cab0f36119f717dfc0bf8cb99;p=tpg%2Facess2.git Added support for skipping to VFS_ReadDir --- diff --git a/Kernel/include/vfs.h b/Kernel/include/vfs.h index 209889cb..99250e12 100644 --- a/Kernel/include/vfs.h +++ b/Kernel/include/vfs.h @@ -85,6 +85,7 @@ typedef struct sVFS_Driver { } tVFS_Driver; // === GLOBALS === +#define VFS_MAXSKIP ((void*)1024) #define VFS_SKIP ((void*)1) #define VFS_SKIPN(n) ((void*)(n)) extern tVFS_Node NULLNode; diff --git a/Kernel/syscalls.c b/Kernel/syscalls.c index 90422cee..f1e08904 100644 --- a/Kernel/syscalls.c +++ b/Kernel/syscalls.c @@ -2,7 +2,7 @@ * AcessOS Microkernel Version * syscalls.c */ -#define DEBUG 1 +#define DEBUG 0 #include #include diff --git a/Kernel/vfs/dir.c b/Kernel/vfs/dir.c index b7af755b..d3214a4b 100644 --- a/Kernel/vfs/dir.c +++ b/Kernel/vfs/dir.c @@ -153,7 +153,13 @@ int VFS_ReadDir(int FD, char *Dest) return 0; } - tmp = h->Node->ReadDir(h->Node, h->Position); + do { + tmp = h->Node->ReadDir(h->Node, h->Position); + if((Uint)tmp < (Uint)VFS_MAXSKIP) + h->Position += (Uint)tmp; + else + h->Position ++; + } while((Uint)tmp < (Uint)VFS_MAXSKIP); LOG("tmp = '%s'", tmp); if(!tmp) { @@ -161,8 +167,6 @@ int VFS_ReadDir(int FD, char *Dest) return 0; } - h->Position ++; - strcpy(Dest, tmp); if(IsHeap(tmp)) free(tmp);