Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / native_client_sdk / src / libraries / nacl_io / memfs / mem_fs.cc
index 118874d..70da25c 100644 (file)
@@ -29,7 +29,7 @@ Error MemFs::Init(const FsInitArgs& args) {
   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);
@@ -105,10 +105,6 @@ Error MemFs::OpenWithMode(const Path& path, int open_flags, mode_t mode,
   } 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;
@@ -146,7 +142,7 @@ Error MemFs::Mkdir(const Path& path, int mode) {
   // 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;