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

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

Issue 320983002: [NaCl SDK] nacl_io: Allows subtree of html5fs to be mounted. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
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/node.h" 5 #include "nacl_io/node.h"
6 6
7 #include <assert.h> 7 #include <assert.h>
8 #include <errno.h> 8 #include <errno.h>
9 #include <fcntl.h> 9 #include <fcntl.h>
10 #include <poll.h> 10 #include <poll.h>
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 return stat_.st_mode & S_IFMT; 193 return stat_.st_mode & S_IFMT;
194 } 194 }
195 195
196 void Node::SetType(int type) { 196 void Node::SetType(int type) {
197 assert((type & ~S_IFMT) == 0); 197 assert((type & ~S_IFMT) == 0);
198 stat_.st_mode &= ~S_IFMT; 198 stat_.st_mode &= ~S_IFMT;
199 stat_.st_mode |= type; 199 stat_.st_mode |= type;
200 } 200 }
201 201
202 bool Node::IsaDir() { 202 bool Node::IsaDir() {
203 return (stat_.st_mode & S_IFDIR) != 0; 203 return GetType() == S_IFDIR;
204 } 204 }
205 205
206 bool Node::IsaFile() { 206 bool Node::IsaFile() {
207 return (stat_.st_mode & S_IFREG) != 0; 207 return GetType() == S_IFREG;
208 } 208 }
209 209
210 bool Node::IsaSock() { 210 bool Node::IsaSock() {
211 return (stat_.st_mode & S_IFSOCK) != 0; 211 return GetType() == S_IFSOCK;
212 } 212 }
213 213
214 Error Node::Isatty() { 214 Error Node::Isatty() {
215 return ENOTTY; 215 return ENOTTY;
216 } 216 }
217 217
218 Error Node::AddChild(const std::string& name, const ScopedNode& node) { 218 Error Node::AddChild(const std::string& name, const ScopedNode& node) {
219 return ENOTDIR; 219 return ENOTDIR;
220 } 220 }
221 221
(...skipping 12 matching lines...) Expand all
234 234
235 void Node::Link() { 235 void Node::Link() {
236 stat_.st_nlink++; 236 stat_.st_nlink++;
237 } 237 }
238 238
239 void Node::Unlink() { 239 void Node::Unlink() {
240 stat_.st_nlink--; 240 stat_.st_nlink--;
241 } 241 }
242 242
243 } // namespace nacl_io 243 } // namespace nacl_io
OLDNEW
« no previous file with comments | « native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc ('k') | native_client_sdk/src/tests/nacl_io_test/html5_fs_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698