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

Unified Diff: runtime/bin/file_linux.cc

Issue 102663005: Add comment to File copy on linux/android. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years 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 | « runtime/bin/file_android.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/file_linux.cc
diff --git a/runtime/bin/file_linux.cc b/runtime/bin/file_linux.cc
index 3114d01c0be8aba4161a2881c513190526393cc0..856ec0bd1dd14b61c4b69defceedc5cd7bd43fac 100644
--- a/runtime/bin/file_linux.cc
+++ b/runtime/bin/file_linux.cc
@@ -245,6 +245,9 @@ bool File::Copy(const char* old_path, const char* new_path) {
result = TEMP_FAILURE_RETRY(
sendfile64(new_fd, old_fd, &offset, kMaxUint32));
}
+ // From sendfile man pages:
+ // Applications may wish to fall back to read(2)/write(2) in the case
+ // where sendfile() fails with EINVAL or ENOSYS.
if (result < 0 && (errno == EINVAL || errno == ENOSYS)) {
const intptr_t kBufferSize = 8 * 1024;
uint8_t buffer[kBufferSize];
« no previous file with comments | « runtime/bin/file_android.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698