X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Fvfs%2Fdir.c;h=3e004b91d538439af85232e8f404a03051571356;hb=a054fab667b0ebb7ea2c91181a961b3fdcc330a1;hp=22249ef681069a5c7315f9f658e139b5f40140ad;hpb=8fef00cfab98773a519ab909fa9da9dc7af692db;p=tpg%2Facess2.git diff --git a/Kernel/vfs/dir.c b/Kernel/vfs/dir.c index 22249ef6..3e004b91 100644 --- a/Kernel/vfs/dir.c +++ b/Kernel/vfs/dir.c @@ -3,7 +3,7 @@ * - Directory Management Functions */ #define DEBUG 0 -#include +#include #include #include @@ -34,25 +34,39 @@ 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; 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); else parent = VFS_ParsePath(absPath, NULL); - if(!parent) return -1; // Error Check + LOG("parent = %p", parent); + + if(!parent) { + LEAVE('i', -1); + return -1; // Error Check + } // Permissions Check if( !VFS_CheckACL(parent, VFS_PERM_EXECUTE|VFS_PERM_WRITE) ) { @@ -62,7 +76,7 @@ int VFS_MkNod(char *Path, Uint Flags) return -1; } - LOG("parent = %p\n", parent); + LOG("parent = %p", parent); if(parent->MkNod == NULL) { Warning("VFS_MkNod - Directory has no MkNod method");