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

Unified Diff: runtime/bin/file_win.cc

Issue 13828005: dart:io | Remove some unneeded global error save/restore pairs on Windows. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/file_win.cc
diff --git a/runtime/bin/file_win.cc b/runtime/bin/file_win.cc
index 86e808c1ddac61fd56ce1d89cb70df83e89cb49e..78074cc820bbac03b5640fe52e8c2dda8bfcd9d5 100644
--- a/runtime/bin/file_win.cc
+++ b/runtime/bin/file_win.cc
@@ -325,14 +325,12 @@ char* File::LinkTarget(const char* pathname) {
if (result == 0) {
DWORD error = GetLastError();
CloseHandle(dir_handle);
- free(buffer);
SetLastError(error);
+ free(buffer);
return NULL;
}
if (CloseHandle(dir_handle) == 0) {
- DWORD error = GetLastError();
free(buffer);
- SetLastError(error);
return NULL;
}
@@ -378,10 +376,8 @@ char* File::LinkTarget(const char* pathname) {
utf8_length,
NULL,
NULL)) {
- DWORD error = GetLastError();
free(buffer);
free(utf8_target);
- SetLastError(error);
return NULL;
}
utf8_target[utf8_length] = '\0';
@@ -531,9 +527,7 @@ File::Identical File::AreIdentical(const char* file_1, const char* file_2) {
FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT,
NULL);
if (file_handle == INVALID_HANDLE_VALUE) {
- DWORD error = GetLastError();
free(const_cast<wchar_t*>(wide_name));
- SetLastError(error);
return File::kError;
}
free(const_cast<wchar_t*>(wide_name));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698