+
+ // Check ACLs on the parent
+ if( !VFS_CheckACL(pnode, VFS_PERM_EXECUTE|VFS_PERM_WRITE) ) {
+ errno = EACCES;
+ goto _pnode_err;
+ }
+
+ // Check that there's a MkNod method
+ if( !pnode->Type || !pnode->Type->MkNod ) {
+ Log_Warning("VFS", "VFS_Open - Directory has no MkNod method");
+ errno = EINVAL;
+ goto _pnode_err;
+ }
+
+ node = pnode->Type->MkNod(pnode, file, new_flags);
+ if( !node ) {
+ LOG("Cannot create node '%s' in '%s'", file, absPath);
+ errno = ENOENT;
+ goto _pnode_err;
+ }
+ // Set mountpoint (and increment open handle count)
+ mnt = pmnt;
+ _ReferenceMount(mnt, "Open - create");
+ // Fall through on error check
+
+ _CloseNode(pnode);
+ _DereferenceMount(pmnt, "Open - create");
+ goto _pnode_ok;
+
+ _pnode_err:
+ if( pnode ) {
+ _CloseNode(pnode);
+ _DereferenceMount(pmnt, "Open - create,fail");
+ free(absPath);
+ }
+ LEAVE('i', -1);
+ return -1;