X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Fvfs%2Fio.c;h=7260df70bebf5212e6562644398fdcfc6fc50fdd;hb=717454930aa0e255517c68c837927deac49bd78e;hp=67d384c1d42e90e51add86fb8000d6653062c7b5;hpb=abe6c6cf7fac39102e20cd28687b24c67f4952f8;p=tpg%2Facess2.git diff --git a/Kernel/vfs/io.c b/Kernel/vfs/io.c index 67d384c1..7260df70 100644 --- a/Kernel/vfs/io.c +++ b/Kernel/vfs/io.c @@ -2,22 +2,11 @@ * AcessMicro VFS * - File IO Passthru's */ +#define DEBUG 0 #include #include "vfs.h" #include "vfs_int.h" -#define DEBUG 0 - -#if DEBUG -#else -# undef ENTER -# undef LOG -# undef LEAVE -# define ENTER(...) -# define LOG(...) -# define LEAVE(...) -#endif - // === CODE === /** * \fn Uint64 VFS_Read(int FD, Uint64 Length, void *Buffer) @@ -31,23 +20,15 @@ Uint64 VFS_Read(int FD, Uint64 Length, void *Buffer) ENTER("iFD XLength pBuffer", FD, Length, Buffer); h = VFS_GetHandle(FD); - if(!h) return -1; + if(!h) LEAVE_RET('i', -1); - if( !(h->Mode & VFS_OPENFLAG_READ) || h->Node->Flags & VFS_FFLAG_DIRECTORY ) { - LEAVE('i', -1); - return -1; - } + if( !(h->Mode & VFS_OPENFLAG_READ) || h->Node->Flags & VFS_FFLAG_DIRECTORY ) + LEAVE_RET('i', -1); - if(!h->Node->Read) { - LEAVE('i', 0); - return 0; - } + if(!h->Node->Read) LEAVE_RET('i', 0); ret = h->Node->Read(h->Node, h->Position, Length, Buffer); - if(ret == -1) { - LEAVE('i', -1); - return -1; - } + if(ret == -1) LEAVE_RET('i', -1); h->Position += ret; LEAVE('X', ret);