| 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 <unistd.h> | |
| 10 | 9 |
| 11 #include <string> | 10 #include <string> |
| 12 | 11 |
| 13 #include "nacl_io/mount.h" | 12 #include "nacl_io/mount.h" |
| 14 #include "nacl_io/mount_node.h" | 13 #include "nacl_io/mount_node.h" |
| 15 #include "nacl_io/mount_node_dir.h" | 14 #include "nacl_io/mount_node_dir.h" |
| 16 #include "nacl_io/mount_node_mem.h" | 15 #include "nacl_io/mount_node_mem.h" |
| 17 #include "nacl_io/osstat.h" | 16 #include "nacl_io/osstat.h" |
| 17 #include "nacl_io/osunistd.h" |
| 18 #include "nacl_io/path.h" | 18 #include "nacl_io/path.h" |
| 19 #include "sdk_util/auto_lock.h" | 19 #include "sdk_util/auto_lock.h" |
| 20 #include "sdk_util/ref_object.h" | 20 #include "sdk_util/ref_object.h" |
| 21 | 21 |
| 22 MountMem::MountMem() : root_(NULL), max_ino_(0) {} | 22 MountMem::MountMem() : root_(NULL), max_ino_(0) {} |
| 23 | 23 |
| 24 Error MountMem::Init(int dev, StringMap_t& args, PepperInterface* ppapi) { | 24 Error MountMem::Init(int dev, StringMap_t& args, PepperInterface* ppapi) { |
| 25 Error error = Mount::Init(dev, args, ppapi); | 25 Error error = Mount::Init(dev, args, ppapi); |
| 26 if (error) | 26 if (error) |
| 27 return error; | 27 return error; |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 return ENOTDIR; | 240 return ENOTDIR; |
| 241 | 241 |
| 242 if (file_only && child->IsaDir()) | 242 if (file_only && child->IsaDir()) |
| 243 return EISDIR; | 243 return EISDIR; |
| 244 | 244 |
| 245 if (remove_dir && child->ChildCount() > 0) | 245 if (remove_dir && child->ChildCount() > 0) |
| 246 return ENOTEMPTY; | 246 return ENOTEMPTY; |
| 247 | 247 |
| 248 return parent->RemoveChild(path.Basename()); | 248 return parent->RemoveChild(path.Basename()); |
| 249 } | 249 } |
| OLD | NEW |