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

Unified Diff: runtime/bin/process_linux.cc

Issue 9193014: Save and restore errno in signal handler. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add Windows binary so base version is the same. Created 8 years, 11 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/process_macos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/process_linux.cc
diff --git a/runtime/bin/process_linux.cc b/runtime/bin/process_linux.cc
index 94af186d56b3b722d4a932cab097d28221fd7def..64d8545a24c2564229352362bc71642668509bf5 100644
--- a/runtime/bin/process_linux.cc
+++ b/runtime/bin/process_linux.cc
@@ -88,6 +88,8 @@ static void SetChildOsErrorMessage(char* os_error_message,
void ExitHandler(int process_signal, siginfo_t* siginfo, void* tmp) {
int pid = 0;
int status = 0;
+ // Save errno so it can be restored at the end.
+ int entry_errno = errno;
while ((pid = TEMP_FAILURE_RETRY(waitpid(-1, &status, WNOHANG))) > 0) {
int exit_code = 0;
int negative = 0;
@@ -109,6 +111,7 @@ void ExitHandler(int process_signal, siginfo_t* siginfo, void* tmp) {
TEMP_FAILURE_RETRY(close(process->fd()));
}
}
+ errno = entry_errno;
}
« no previous file with comments | « no previous file | runtime/bin/process_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698