| Index: runtime/bin/file_android.cc
|
| diff --git a/runtime/bin/file_android.cc b/runtime/bin/file_android.cc
|
| index e253417065828ccdc13062742df61170a9003965..0176ba632fa4f6571e14c14c937161ab172f0c8b 100644
|
| --- a/runtime/bin/file_android.cc
|
| +++ b/runtime/bin/file_android.cc
|
| @@ -244,8 +244,11 @@ bool File::Copy(const char* old_path, const char* new_path) {
|
| result = TEMP_FAILURE_RETRY(
|
| sendfile(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;
|
| + const intptr_t kBufferSize = 8 * KB;
|
| uint8_t buffer[kBufferSize];
|
| while ((result = TEMP_FAILURE_RETRY(
|
| read(old_fd, buffer, kBufferSize))) > 0) {
|
|
|