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

Side by Side Diff: native_client_sdk/src/libraries/nacl_mounts/mount.cc

Issue 10829027: [NaCl SDK] Add nacl_mounts to NaCl SDK build. Experimental for now. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix for windows Created 8 years, 4 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 (c) 2012 The Chromium Authors. All rights reserved. 1 /* Copyright (c) 2012 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 <dirent.h> 5 #include "nacl_mounts/mount.h"
6
6 #include <errno.h> 7 #include <errno.h>
7 #include <fcntl.h> 8 #include <fcntl.h>
8 #include <sys/stat.h>
9 #include <string> 9 #include <string>
10 10
11 #include "auto_lock.h"
12 #include "ref_object.h"
13
14 #include "nacl_mounts/mount.h"
15 #include "nacl_mounts/mount_node.h" 11 #include "nacl_mounts/mount_node.h"
16 #include "nacl_mounts/mount_node_dir.h" 12 #include "nacl_mounts/mount_node_dir.h"
17 #include "nacl_mounts/mount_node_mem.h" 13 #include "nacl_mounts/mount_node_mem.h"
14 #include "nacl_mounts/osstat.h"
18 #include "nacl_mounts/path.h" 15 #include "nacl_mounts/path.h"
19 16 #include "utils/auto_lock.h"
17 #include "utils/ref_object.h"
20 18
21 Mount::Mount() 19 Mount::Mount()
22 : dev_(0) { 20 : dev_(0) {
23 } 21 }
24 22
25 Mount::~Mount() {} 23 Mount::~Mount() {}
26 24
27 bool Mount::Init(int dev, StringMap_t& args) { 25 bool Mount::Init(int dev, StringMap_t& args) {
28 dev_ = dev; 26 dev_ = dev;
29 return true; 27 return true;
(...skipping 13 matching lines...) Expand all
43 41
44 int Mount::OpenModeToPermission(int mode) { 42 int Mount::OpenModeToPermission(int mode) {
45 int out; 43 int out;
46 switch (mode & 3) { 44 switch (mode & 3) {
47 case O_RDONLY: out = S_IREAD; 45 case O_RDONLY: out = S_IREAD;
48 case O_WRONLY: out = S_IWRITE; 46 case O_WRONLY: out = S_IWRITE;
49 case O_RDWR: out = S_IREAD | S_IWRITE; 47 case O_RDWR: out = S_IREAD | S_IWRITE;
50 } 48 }
51 return out; 49 return out;
52 } 50 }
53
54
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698