X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;ds=sidebyside;f=Kernel%2Fvfs%2Fdir.c;h=e87b5a3127c87170ad591170bab84774ff359356;hb=3c777e58e6baba6760f43b8fdde4daf62081048b;hp=15f90b61b8a39b358c179bacf200e96fcdcb6092;hpb=d7801bfc828d3328ac9a0172db8a71b8f33c4a19;p=tpg%2Facess2.git diff --git a/Kernel/vfs/dir.c b/Kernel/vfs/dir.c index 15f90b61..e87b5a31 100644 --- a/Kernel/vfs/dir.c +++ b/Kernel/vfs/dir.c @@ -1,7 +1,11 @@ /* + * Acess2 VFS + * - Directory Management Functions */ -#include "vfs.h" -#include "vfs_int.h" +#define DEBUG 1 +#include +#include +#include // === IMPORTS === extern tVFS_Mount *gRootMount; @@ -30,18 +34,27 @@ int VFS_MkDir(char *Path) int VFS_MkNod(char *Path, Uint Flags) { char *absPath, *name; - int pos=0, oldpos = 0; + int pos = 0, oldpos = 0; + int next = 0; tVFS_Node *parent; int ret; - Debug_Enter("VFS_MkNod", "sPath xFlags", Path, Flags); + ENTER("sPath xFlags", Path, Flags); absPath = VFS_GetAbsPath(Path); + LOG("absPath = '%s'", absPath); - while( (pos = strpos8(&absPath[pos+1], '/')) != -1 ) oldpos = pos; + while( (next = strpos(&absPath[pos+1], '/')) != -1 ) { + LOG("next = %i", next); + pos += next+1; + LOG("pos = %i", pos); + oldpos = pos; + } absPath[oldpos] = '\0'; // Mutilate path name = &absPath[oldpos+1]; + LOG("absPath = '%s', name = '%s'", absPath, name); + // Check for root if(absPath[0] == '\0') parent = VFS_ParsePath("/", NULL); @@ -54,15 +67,15 @@ int VFS_MkNod(char *Path, Uint Flags) if( !VFS_CheckACL(parent, VFS_PERM_EXECUTE|VFS_PERM_WRITE) ) { if(parent->Close) parent->Close( parent ); free(absPath); - Debug_Leave("VFS_MkNod", 'i', -1); + LEAVE('i', -1); return -1; } - Debug_Log("VFS_MkNod", "parent = %p\n", parent); + LOG("parent = %p", parent); if(parent->MkNod == NULL) { Warning("VFS_MkNod - Directory has no MkNod method"); - Debug_Leave("VFS_MkNod", 'i', -1); + LEAVE('i', -1); return -1; } @@ -76,9 +89,12 @@ int VFS_MkNod(char *Path, Uint Flags) if(parent->Close) parent->Close( parent ); // Error Check - if(ret == 0) return -1; + if(ret == 0) { + LEAVE('i', -1); + return -1; + } - Debug_Leave("VFS_MkNod", 'i', 0); + LEAVE('i', 0); return 0; } @@ -94,7 +110,7 @@ int VFS_Symlink(char *Name, char *Link) int fp; tVFS_Node *destNode; - //LogF("vfs_symlink: (name='%s', link='%s')\n", name, link); + //ENTER("sName sLink", Name, Link); // Get absolue path name Link = VFS_GetAbsPath( Link );