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

Unified Diff: native_client_sdk/src/libraries/nacl_io/kernel_handle.cc

Issue 73083005: [NaCl SDK] Enable linux host build for nacl_io and nacl_io_tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: native_client_sdk/src/libraries/nacl_io/kernel_handle.cc
diff --git a/native_client_sdk/src/libraries/nacl_io/kernel_handle.cc b/native_client_sdk/src/libraries/nacl_io/kernel_handle.cc
index 1eaa88e0b7669d895c134fdc7b90b5a396ac09ec..5736a3ac875b0c753ec23a68561bd6aa632a5e89 100644
--- a/native_client_sdk/src/libraries/nacl_io/kernel_handle.cc
+++ b/native_client_sdk/src/libraries/nacl_io/kernel_handle.cc
@@ -55,7 +55,7 @@ Error KernelHandle::Init(int open_flags) {
Error KernelHandle::Seek(off_t offset, int whence, off_t* out_offset) {
// By default, don't move the offset.
*out_offset = offset;
- size_t base;
+ ssize_t base;
size_t node_size;
AUTO_LOCK(handle_lock_);
@@ -64,8 +64,6 @@ Error KernelHandle::Seek(off_t offset, int whence, off_t* out_offset) {
return error;
switch (whence) {
- default:
- return -1;
case SEEK_SET:
base = 0;
break;
@@ -75,12 +73,14 @@ Error KernelHandle::Seek(off_t offset, int whence, off_t* out_offset) {
case SEEK_END:
base = node_size;
break;
+ default:
+ return -1;
}
if (base + offset < 0)
return EINVAL;
- off_t new_offset = base + offset;
+ size_t new_offset = base + offset;
// Seeking past the end of the file will zero out the space between the old
// end and the new end.
« no previous file with comments | « native_client_sdk/src/libraries/nacl_io/fifo_null.h ('k') | native_client_sdk/src/libraries/nacl_io/kernel_wrap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698