Index: runtime/bin/file_linux.cc |
diff --git a/runtime/bin/file_linux.cc b/runtime/bin/file_linux.cc |
index 92c5637c6158ae1958b97bf8d22de00fad38511a..4753a8b6cc8c3a634ab6e1985c5a9674233119ce 100644 |
--- a/runtime/bin/file_linux.cc |
+++ b/runtime/bin/file_linux.cc |
@@ -265,10 +265,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; |