Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(409)

Side by Side Diff: native_client_sdk/src/libraries/nacl_io/dir_node.cc

Issue 648763003: [NaCl SDK] nacl_io: Mask mode before passing to Node::SetMode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | native_client_sdk/src/libraries/nacl_io/memfs/mem_fs_node.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "nacl_io/dir_node.h" 5 #include "nacl_io/dir_node.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <string.h> 8 #include <string.h>
9 9
10 #include "nacl_io/log.h" 10 #include "nacl_io/log.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 dirent* pdir, 64 dirent* pdir,
65 size_t size, 65 size_t size,
66 int* out_bytes) { 66 int* out_bytes) {
67 AUTO_LOCK(node_lock_); 67 AUTO_LOCK(node_lock_);
68 BuildCache_Locked(); 68 BuildCache_Locked();
69 return cache_.GetDents(offs, pdir, size, out_bytes); 69 return cache_.GetDents(offs, pdir, size, out_bytes);
70 } 70 }
71 71
72 Error DirNode::Fchmod(mode_t mode) { 72 Error DirNode::Fchmod(mode_t mode) {
73 AUTO_LOCK(node_lock_); 73 AUTO_LOCK(node_lock_);
74 SetMode(mode); 74 SetMode(mode & ~S_IFMT);
75 return 0; 75 return 0;
76 } 76 }
77 77
78 Error DirNode::AddChild(const std::string& name, const ScopedNode& node) { 78 Error DirNode::AddChild(const std::string& name, const ScopedNode& node) {
79 AUTO_LOCK(node_lock_); 79 AUTO_LOCK(node_lock_);
80 80
81 if (name.empty()) { 81 if (name.empty()) {
82 LOG_ERROR("Can't add child with no name."); 82 LOG_ERROR("Can't add child with no name.");
83 return ENOENT; 83 return ENOENT;
84 } 84 }
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 144
145 cache_built_ = true; 145 cache_built_ = true;
146 } 146 }
147 147
148 void DirNode::ClearCache_Locked() { 148 void DirNode::ClearCache_Locked() {
149 cache_built_ = false; 149 cache_built_ = false;
150 cache_.Reset(); 150 cache_.Reset();
151 } 151 }
152 152
153 } // namespace nacl_io 153 } // namespace nacl_io
OLDNEW
« no previous file with comments | « no previous file | native_client_sdk/src/libraries/nacl_io/memfs/mem_fs_node.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698