- // Check if is a directory
- if( !(node->Flags & VFS_FFLAG_DIRECTORY) ) {
- Log("VFS_ChDir: Not a directory");
- if(node->Close) node->Close(node);
+ // Get node so we can check for directory
+ h = VFS_GetHandle(fd);
+ if( !(h->Node->Flags & VFS_FFLAG_DIRECTORY) ) {
+ Log("VFS_ChDir: Path is not a directory");
+ VFS_Close(fd);