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

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

Issue 474433005: [NaCl SDK] Remove syscalls wrappers for chmod and unlink. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 "nacl_io/kernel_object.h" 5 #include "nacl_io/kernel_object.h"
6 6
7 #include <assert.h> 7 #include <assert.h>
8 #include <errno.h> 8 #include <errno.h>
9 #include <fcntl.h> 9 #include <fcntl.h>
10 #include <pthread.h> 10 #include <pthread.h>
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 error = (*out_fs)->Open(rel_parts, oflags, out_node); 112 error = (*out_fs)->Open(rel_parts, oflags, out_node);
113 if (error) 113 if (error)
114 return error; 114 return error;
115 115
116 return 0; 116 return 0;
117 } 117 }
118 118
119 Path KernelObject::GetAbsParts(const std::string& path) { 119 Path KernelObject::GetAbsParts(const std::string& path) {
120 AUTO_LOCK(cwd_lock_); 120 AUTO_LOCK(cwd_lock_);
121 121
122 Path abs_parts(cwd_); 122 Path abs_parts;
123 if (path[0] == '/') { 123 if (path[0] == '/') {
124 abs_parts = path; 124 abs_parts = path;
125 } else { 125 } else {
126 abs_parts = cwd_; 126 abs_parts = cwd_;
127 abs_parts.Append(path); 127 abs_parts.Append(path);
128 } 128 }
129 129
130 return abs_parts; 130 return abs_parts;
131 } 131 }
132 132
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 AUTO_LOCK(handle_lock_); 254 AUTO_LOCK(handle_lock_);
255 255
256 handle_map_[fd].handle.reset(NULL); 256 handle_map_[fd].handle.reset(NULL);
257 free_fds_.push_back(fd); 257 free_fds_.push_back(fd);
258 258
259 // Force lower numbered FD to be available first. 259 // Force lower numbered FD to be available first.
260 std::push_heap(free_fds_.begin(), free_fds_.end(), std::greater<int>()); 260 std::push_heap(free_fds_.begin(), free_fds_.end(), std::greater<int>());
261 } 261 }
262 262
263 } // namespace nacl_io 263 } // namespace nacl_io
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698