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

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

Issue 12194030: Rename mount (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix whitespace Created 7 years, 10 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_mounts/kernel_handle.h" 5 #include "nacl_io/kernel_handle.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <fcntl.h> 8 #include <fcntl.h>
9 #include <pthread.h> 9 #include <pthread.h>
10 10
11 #ifndef WIN32 11 #ifndef WIN32
12 // Needed for SEEK_SET/SEEK_CUR/SEEK_END. 12 // Needed for SEEK_SET/SEEK_CUR/SEEK_END.
13 #include <unistd.h> 13 #include <unistd.h>
14 #endif 14 #endif
15 15
16 #include "nacl_mounts/mount.h" 16 #include "nacl_io/mount.h"
17 #include "nacl_mounts/mount_node.h" 17 #include "nacl_io/mount_node.h"
18 18
19 // It is only legal to construct a handle while the kernel lock is held. 19 // It is only legal to construct a handle while the kernel lock is held.
20 KernelHandle::KernelHandle(Mount* mnt, MountNode* node, int mode) 20 KernelHandle::KernelHandle(Mount* mnt, MountNode* node, int mode)
21 : mount_(mnt), 21 : mount_(mnt),
22 node_(node), 22 node_(node),
23 mode_(mode), 23 mode_(mode),
24 offs_(0) { 24 offs_(0) {
25 if (mode & O_APPEND) offs_ = node->GetSize(); 25 if (mode & O_APPEND) offs_ = node->GetSize();
26 } 26 }
27 27
(...skipping 19 matching lines...) Expand all
47 // end and the new end. 47 // end and the new end.
48 if (offs_ > node_size) { 48 if (offs_ > node_size) {
49 if (node_->Truncate(offs_) < 0) { 49 if (node_->Truncate(offs_) < 0) {
50 errno = EINVAL; 50 errno = EINVAL;
51 return -1; 51 return -1;
52 } 52 }
53 } 53 }
54 54
55 return offs_; 55 return offs_;
56 } 56 }
OLDNEW
« no previous file with comments | « native_client_sdk/src/libraries/nacl_io/kernel_handle.h ('k') | native_client_sdk/src/libraries/nacl_io/kernel_intercept.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698