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

Unified Diff: native_client_sdk/src/libraries/nacl_io/fusefs/fuse_fs.cc

Issue 549353003: [NaCl SDK] nacl_io: Fix FuseFs.{read,write} (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | native_client_sdk/src/tests/nacl_io_test/fuse_fs_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: native_client_sdk/src/libraries/nacl_io/fusefs/fuse_fs.cc
diff --git a/native_client_sdk/src/libraries/nacl_io/fusefs/fuse_fs.cc b/native_client_sdk/src/libraries/nacl_io/fusefs/fuse_fs.cc
index fdf74be4a6e2be24f93dfae0ad839f2c150dfcf5..5763d86672ed02dd296fdafffd949e42b2f70d59 100644
--- a/native_client_sdk/src/libraries/nacl_io/fusefs/fuse_fs.cc
+++ b/native_client_sdk/src/libraries/nacl_io/fusefs/fuse_fs.cc
@@ -341,13 +341,11 @@ Error FileFuseFsNode::Read(const HandleAttr& attr,
if (result < 0)
return -result;
- // Fuse docs say that a read() call will always completely fill the buffer
- // (padding with zeroes) unless the direct_io filesystem flag is set.
// TODO(binji): support the direct_io flag
if (static_cast<size_t>(result) < count)
memset(&cbuf[result], 0, count - result);
- *out_bytes = count;
+ *out_bytes = result;
return 0;
}
@@ -365,9 +363,6 @@ Error FileFuseFsNode::Write(const HandleAttr& attr,
if (result < 0)
return -result;
- // Fuse docs say that a write() call will always write the entire buffer
- // unless the direct_io filesystem flag is set.
- // TODO(binji): What should we do if the user breaks this contract? Warn?
// TODO(binji): support the direct_io flag
*out_bytes = result;
return 0;
« no previous file with comments | « no previous file | native_client_sdk/src/tests/nacl_io_test/fuse_fs_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698