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

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

Issue 547713002: [NaCl SDK] nacl_io: Always create directory node in http filesystem root. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 int Node::GetType() { 192 int Node::GetType() {
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 void Node::SetMode(int mode) {
203 assert((mode & S_IFMT) == 0);
204 stat_.st_mode &= S_IFMT;
205 stat_.st_mode |= mode;
206 }
207
202 bool Node::IsaDir() { 208 bool Node::IsaDir() {
203 return GetType() == S_IFDIR; 209 return GetType() == S_IFDIR;
204 } 210 }
205 211
206 bool Node::IsaFile() { 212 bool Node::IsaFile() {
207 return GetType() == S_IFREG; 213 return GetType() == S_IFREG;
208 } 214 }
209 215
210 bool Node::IsaSock() { 216 bool Node::IsaSock() {
211 return GetType() == S_IFSOCK; 217 return GetType() == S_IFSOCK;
(...skipping 22 matching lines...) Expand all
234 240
235 void Node::Link() { 241 void Node::Link() {
236 stat_.st_nlink++; 242 stat_.st_nlink++;
237 } 243 }
238 244
239 void Node::Unlink() { 245 void Node::Unlink() {
240 stat_.st_nlink--; 246 stat_.st_nlink--;
241 } 247 }
242 248
243 } // namespace nacl_io 249 } // namespace nacl_io
OLDNEW
« no previous file with comments | « native_client_sdk/src/libraries/nacl_io/node.h ('k') | native_client_sdk/src/tests/nacl_io_test/http_fs_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698