+ // Find Child
+ node = h->Node->FindDir(h->Node, Name);
+ if(!node) {
+ if(Errno) *Errno = ENOENT;
+ LEAVE('i', -1);
+ return -1;
+ }
+
+ i = 0;
+ i |= (Mode & VFS_OPENFLAG_EXEC) ? VFS_PERM_EXECUTE : 0;
+ i |= (Mode & VFS_OPENFLAG_READ) ? VFS_PERM_READ : 0;
+ i |= (Mode & VFS_OPENFLAG_WRITE) ? VFS_PERM_WRITE : 0;
+
+ // Permissions Check
+ if( !VFS_CheckACL(node, i) ) {
+ if(node->Close) node->Close( node );
+ Log_Notice("VFS", "VFS_OpenChild - Permissions Failed");
+ if(Errno) *Errno = EACCES;
+ LEAVE('i', -1);
+ return -1;
+ }
+
+ i = VFS_AllocHandle( !!(Mode & VFS_OPENFLAG_USER), node, Mode );
+ if( i >= 0 ) {
+ LEAVE('x', i);
+ return i;
+ }
+
+ Log_Error("VFS", "VFS_OpenChild - Out of handles");
+ if(Errno) *Errno = ENFILE;