X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FKernel%2Fvfs%2Fdir.c;h=26f6f0f449474dbaa6812f0d9ce554566deb0035;hb=f19a9d7e00271ffbba6e827da3b553b900acc33c;hp=d4c153096f6ad94d43ce081a3f0de27f51554875;hpb=51ab5f489bc356940c95cc936fd0508e8f07ea97;p=tpg%2Facess2.git diff --git a/KernelLand/Kernel/vfs/dir.c b/KernelLand/Kernel/vfs/dir.c index d4c15309..26f6f0f4 100644 --- a/KernelLand/Kernel/vfs/dir.c +++ b/KernelLand/Kernel/vfs/dir.c @@ -36,6 +36,7 @@ int VFS_MkDir(const char *Path) */ int VFS_MkNod(const char *Path, Uint Flags) { + tVFS_Mount *mountpt; char *absPath, *name; int pos = 0, oldpos = 0; int next = 0; @@ -60,9 +61,9 @@ int VFS_MkNod(const char *Path, Uint Flags) // Check for root if(absPath[0] == '\0') - parent = VFS_ParsePath("/", NULL, NULL); + parent = VFS_ParsePath("/", NULL, &mountpt); else - parent = VFS_ParsePath(absPath, NULL, NULL); + parent = VFS_ParsePath(absPath, NULL, &mountpt); LOG("parent = %p", parent); @@ -70,10 +71,11 @@ int VFS_MkNod(const char *Path, Uint Flags) LEAVE('i', -1); return -1; // Error Check } - + // Permissions Check if( !VFS_CheckACL(parent, VFS_PERM_EXECUTE|VFS_PERM_WRITE) ) { _CloseNode(parent); + mountpt->OpenHandleCount --; free(absPath); LEAVE('i', -1); return -1; @@ -82,7 +84,8 @@ int VFS_MkNod(const char *Path, Uint Flags) LOG("parent = %p", parent); if(!parent->Type || !parent->Type->MkNod) { - Warning("VFS_MkNod - Directory has no MkNod method"); + Log_Warning("VFS", "VFS_MkNod - Directory has no MkNod method"); + mountpt->OpenHandleCount --; LEAVE('i', -1); return -1; } @@ -94,16 +97,12 @@ int VFS_MkNod(const char *Path, Uint Flags) free(absPath); // Free Parent + mountpt->OpenHandleCount --; _CloseNode(parent); - - // Error Check - if(ret == 0) { - LEAVE('i', -1); - return -1; - } - - LEAVE('i', 0); - return 0; + + // Return whatever the driver said + LEAVE('i', ret); + return ret; } /**