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

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

Issue 635113002: [NaCl SDK] nacl_io: Fix real_node when dealing with a windows terminal (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « no previous file | native_client_sdk/src/libraries/nacl_io/getdents_helper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/dir_node.h" 5 #include "nacl_io/dir_node.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <string.h> 8 #include <string.h>
9 9
10 #include "nacl_io/log.h" 10 #include "nacl_io/log.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 85
86 if (name.length() >= MEMBER_SIZE(dirent, d_name)) { 86 if (name.length() >= MEMBER_SIZE(dirent, d_name)) {
87 LOG_ERROR("Child name is too long: %" PRIuS " >= %" PRIuS, 87 LOG_ERROR("Child name is too long: %" PRIuS " >= %" PRIuS,
88 name.length(), 88 name.length(),
89 MEMBER_SIZE(dirent, d_name)); 89 MEMBER_SIZE(dirent, d_name));
90 return ENAMETOOLONG; 90 return ENAMETOOLONG;
91 } 91 }
92 92
93 NodeMap_t::iterator it = map_.find(name); 93 NodeMap_t::iterator it = map_.find(name);
94 if (it != map_.end()) { 94 if (it != map_.end()) {
95 LOG_TRACE("Can't add child \"%s\", it already exists.", name); 95 LOG_TRACE("Can't add child \"%s\", it already exists.", name.c_str());
96 return EEXIST; 96 return EEXIST;
97 } 97 }
98 98
99 node->Link(); 99 node->Link();
100 map_[name] = node; 100 map_[name] = node;
101 ClearCache_Locked(); 101 ClearCache_Locked();
102 return 0; 102 return 0;
103 } 103 }
104 104
105 Error DirNode::RemoveChild(const std::string& name) { 105 Error DirNode::RemoveChild(const std::string& name) {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 144
145 cache_built_ = true; 145 cache_built_ = true;
146 } 146 }
147 147
148 void DirNode::ClearCache_Locked() { 148 void DirNode::ClearCache_Locked() {
149 cache_built_ = false; 149 cache_built_ = false;
150 cache_.Reset(); 150 cache_.Reset();
151 } 151 }
152 152
153 } // namespace nacl_io 153 } // namespace nacl_io
OLDNEW
« no previous file with comments | « no previous file | native_client_sdk/src/libraries/nacl_io/getdents_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698