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_mounts/mount_node_dir.h" | 5 #include "nacl_io/mount_node_dir.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #include "nacl_mounts/osdirent.h" | 10 #include "nacl_io/osdirent.h" |
11 #include "nacl_mounts/osstat.h" | 11 #include "nacl_io/osstat.h" |
12 #include "utils/macros.h" | 12 #include "utils/macros.h" |
13 #include "utils/auto_lock.h" | 13 #include "utils/auto_lock.h" |
14 | 14 |
15 MountNodeDir::MountNodeDir(Mount* mount) | 15 MountNodeDir::MountNodeDir(Mount* mount) |
16 : MountNode(mount), | 16 : MountNode(mount), |
17 cache_(NULL) { | 17 cache_(NULL) { |
18 stat_.st_mode |= S_IFDIR; | 18 stat_.st_mode |= S_IFDIR; |
19 } | 19 } |
20 | 20 |
21 MountNodeDir::~MountNodeDir() { | 21 MountNodeDir::~MountNodeDir() { |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 for (size_t index = 0; it != map_.end(); it++, index++) { | 128 for (size_t index = 0; it != map_.end(); it++, index++) { |
129 MountNode* node = it->second; | 129 MountNode* node = it->second; |
130 size_t len = it->first.length(); | 130 size_t len = it->first.length(); |
131 cache_[index].d_ino = node->stat_.st_ino; | 131 cache_[index].d_ino = node->stat_.st_ino; |
132 cache_[index].d_reclen = sizeof(struct dirent); | 132 cache_[index].d_reclen = sizeof(struct dirent); |
133 cache_[index].d_name[len] = 0; | 133 cache_[index].d_name[len] = 0; |
134 strncpy(cache_[index].d_name, &it->first[0], len); | 134 strncpy(cache_[index].d_name, &it->first[0], len); |
135 } | 135 } |
136 } | 136 } |
137 } | 137 } |
OLD | NEW |