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

Unified Diff: base/platform_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 | « base/files/file_posix.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/platform_file_posix.cc
diff --git a/base/platform_file_posix.cc b/base/platform_file_posix.cc
index 028a38276d6fedd3954ff4f2a9df68086418021e..3ecb0aafac925740a0ef2ee340aa6853e0a3b33c 100644
--- a/base/platform_file_posix.cc
+++ b/base/platform_file_posix.cc
@@ -261,7 +261,7 @@ int ReadPlatformFileAtCurrentPos(PlatformFile file, char* data, int size) {
int bytes_read = 0;
int rv;
do {
- rv = HANDLE_EINTR(read(file, data, size));
+ rv = HANDLE_EINTR(read(file, data + bytes_read, size - bytes_read));
if (rv <= 0)
break;
@@ -322,7 +322,7 @@ int WritePlatformFileAtCurrentPos(PlatformFile file,
int bytes_written = 0;
int rv;
do {
- rv = HANDLE_EINTR(write(file, data, size));
+ rv = HANDLE_EINTR(write(file, data + bytes_written, size - bytes_written));
if (rv <= 0)
break;
« no previous file with comments | « base/files/file_posix.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698