if (error)
return error;
- root_.reset(new DirNode(this));
+ root_.reset(new DirNode(this, S_IRALL | S_IWALL | S_IXALL));
error = root_->Init(0);
if (error) {
root_.reset(NULL);
} else {
// Opening an existing file.
- // Directories can only be opened read-only.
- if (node->IsaDir() && (open_flags & 3) != O_RDONLY)
- return EISDIR;
-
// If we were expected to create it exclusively, fail
if (open_flags & O_EXCL)
return EEXIST;
// Allocate a node, with a RefCount of 1. If added to the parent
// it will get ref counted again. In either case, release the
// recount we have on exit.
- node.reset(new DirNode(this));
+ node.reset(new DirNode(this, mode));
error = node->Init(0);
if (error)
return error;