Index: runtime/bin/file_android.cc |
diff --git a/runtime/bin/file_android.cc b/runtime/bin/file_android.cc |
index fb3a616bfa8cbd52816d1e2aa7aada01bc681d9d..0b099bafad6ecd30a1534edffd5a79de88a3380e 100644 |
--- a/runtime/bin/file_android.cc |
+++ b/runtime/bin/file_android.cc |
@@ -266,10 +266,10 @@ bool File::Copy(const char* old_path, const char* new_path) { |
} |
} |
} |
+ int e = errno; |
+ VOID_TEMP_FAILURE_RETRY(close(old_fd)); |
+ VOID_TEMP_FAILURE_RETRY(close(new_fd)); |
if (result < 0) { |
- int e = errno; |
- VOID_TEMP_FAILURE_RETRY(close(old_fd)); |
- VOID_TEMP_FAILURE_RETRY(close(new_fd)); |
VOID_NO_RETRY_EXPECTED(unlink(new_path)); |
errno = e; |
return false; |