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

Unified Diff: base/files/file_posix.cc

Issue 213473007: Implement Read/WriteAtCurrentPos correctly (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | base/platform_file_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/files/file_posix.cc
diff --git a/base/files/file_posix.cc b/base/files/file_posix.cc
index 46d6d94eaaf77c42044bf39146cf05281d0ffc8e..176f1f3fe90fb40087351be004e0d0f9ea55f213 100644
--- a/base/files/file_posix.cc
+++ b/base/files/file_posix.cc
@@ -266,7 +266,7 @@ int File::ReadAtCurrentPos(char* data, int size) {
int bytes_read = 0;
int rv;
do {
- rv = HANDLE_EINTR(read(file_.get(), data, size));
+ rv = HANDLE_EINTR(read(file_.get(), data + bytes_read, size - bytes_read));
if (rv <= 0)
break;
@@ -325,7 +325,8 @@ int File::WriteAtCurrentPos(const char* data, int size) {
int bytes_written = 0;
int rv;
do {
- rv = HANDLE_EINTR(write(file_.get(), data, size));
+ rv = HANDLE_EINTR(write(file_.get(), data + bytes_written,
+ size - bytes_written));
if (rv <= 0)
break;
« no previous file with comments | « no previous file | base/platform_file_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698