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

Unified Diff: base/platform_file_unittest.cc

Issue 7745008: Base: WritePlatformFile now retries the operation if (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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/platform_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_unittest.cc
===================================================================
--- base/platform_file_unittest.cc (revision 97736)
+++ base/platform_file_unittest.cc (working copy)
@@ -37,23 +37,7 @@
// Returns the number of bytes written.
int WriteFully(base::PlatformFile file, int64 offset,
const char* data, int size) {
- int total_bytes_written = 0;
- int bytes_written;
- while (total_bytes_written < size) {
- bytes_written = base::WritePlatformFile(
- file, offset + total_bytes_written, &data[total_bytes_written],
- size - total_bytes_written);
-
- if ((bytes_written == 0) && (size == 0))
- return 0;
-
- if ((bytes_written <= 0) || (bytes_written > size - total_bytes_written))
- return -1;
-
- total_bytes_written += bytes_written;
- }
-
- return total_bytes_written;
+ return base::WritePlatformFile(file, offset, data, size);
}
} // namespace
« no previous file with comments | « base/platform_file_posix.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698