| OLD | NEW |
| 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 "nacl_io/mount_mem.h" | 5 #include "nacl_io/mount_mem.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "nacl_io/mount.h" | 11 #include "nacl_io/mount.h" |
| 12 #include "nacl_io/mount_node.h" | 12 #include "nacl_io/mount_node.h" |
| 13 #include "nacl_io/mount_node_dir.h" | 13 #include "nacl_io/mount_node_dir.h" |
| 14 #include "nacl_io/mount_node_mem.h" | 14 #include "nacl_io/mount_node_mem.h" |
| 15 #include "nacl_io/osstat.h" | 15 #include "nacl_io/osstat.h" |
| 16 #include "nacl_io/path.h" | 16 #include "nacl_io/path.h" |
| 17 #include "utils/auto_lock.h" | 17 #include "sdk_util/auto_lock.h" |
| 18 #include "utils/ref_object.h" | 18 #include "sdk_util/ref_object.h" |
| 19 | 19 |
| 20 // TODO(noelallen) : Grab/Redefine these in the kernel object once available. | 20 // TODO(noelallen) : Grab/Redefine these in the kernel object once available. |
| 21 #define USR_ID 1002 | 21 #define USR_ID 1002 |
| 22 #define GRP_ID 1003 | 22 #define GRP_ID 1003 |
| 23 | 23 |
| 24 MountMem::MountMem() | 24 MountMem::MountMem() |
| 25 : root_(NULL), | 25 : root_(NULL), |
| 26 max_ino_(0) { | 26 max_ino_(0) { |
| 27 } | 27 } |
| 28 | 28 |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 if (file_only && child->IsaDir()) { | 242 if (file_only && child->IsaDir()) { |
| 243 errno = EISDIR; | 243 errno = EISDIR; |
| 244 return -1; | 244 return -1; |
| 245 } | 245 } |
| 246 if (remove_dir && child->ChildCount() > 0) { | 246 if (remove_dir && child->ChildCount() > 0) { |
| 247 errno = ENOTEMPTY; | 247 errno = ENOTEMPTY; |
| 248 return -1; | 248 return -1; |
| 249 } | 249 } |
| 250 return parent->RemoveChild(path.Basename()); | 250 return parent->RemoveChild(path.Basename()); |
| 251 } | 251 } |
| OLD | NEW |