X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;ds=sidebyside;f=KernelLand%2FKernel%2Fvfs%2Fopen.c;h=344b2a14510dea9b897a6c794bd3d119b4b29cdb;hb=cb414d6f5f9730d64b4914e45c14d9c16aea0b6c;hp=e7d6e1e80d2aa7eb0271b125ea349ebd8e1c8690;hpb=4842e2d6740bcb81da4e94019285bfd2c45425b8;p=tpg%2Facess2.git diff --git a/KernelLand/Kernel/vfs/open.c b/KernelLand/Kernel/vfs/open.c index e7d6e1e8..344b2a14 100644 --- a/KernelLand/Kernel/vfs/open.c +++ b/KernelLand/Kernel/vfs/open.c @@ -201,6 +201,7 @@ restart_parse: *TruePath = malloc( gVFS_RootMount->MountPointLen+1 ); strcpy(*TruePath, gVFS_RootMount->MountPoint); } + gVFS_RootMount->OpenHandleCount ++; if(MountPoint) *MountPoint = gVFS_RootMount; LEAVE('p', gVFS_RootMount->RootNode); return gVFS_RootMount->RootNode; @@ -282,9 +283,16 @@ restart_parse: } // Check if the node has a FindDir method + if( !curNode->Type ) + { + LOG("Finddir failure on '%s' - No type", Path); + Log_Error("VFS", "Node at '%s' has no type (mount %s:%s)", + Path, mnt->Filesystem->Name, mnt->MountPoint); + goto _error; + } if( !curNode->Type->FindDir ) { - LOG("Finddir failure on '%s'", Path); + LOG("Finddir failure on '%s' - No FindDir method in %s", Path, curNode->Type->Name); goto _error; } LOG("FindDir{=%p}(%p, '%s')", curNode->Type->FindDir, curNode, pathEle); @@ -646,7 +654,8 @@ void VFS_Close(int FD) _CloseNode(h->Node); - h->Mount->OpenHandleCount --; + if( h->Mount ) + h->Mount->OpenHandleCount --; h->Node = NULL; }