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

Unified Diff: runtime/bin/file_android.cc

Issue 233053004: Fix File:copy FD leak, and add file-closes to some tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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 | « no previous file | runtime/bin/file_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | runtime/bin/file_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698