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

Unified Diff: runtime/bin/process_macos.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 | « runtime/bin/process_linux.cc ('k') | tools/testing/bin/linux/dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/process_macos.cc
diff --git a/runtime/bin/process_macos.cc b/runtime/bin/process_macos.cc
index c42b08114d0991e99a2df5d0976f3077b550afe7..1d0c5e9d17d6bbb0829fb1a4bf8f3469968a2b5d 100644
--- a/runtime/bin/process_macos.cc
+++ b/runtime/bin/process_macos.cc
@@ -87,6 +87,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;
@@ -108,6 +110,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 | « runtime/bin/process_linux.cc ('k') | tools/testing/bin/linux/dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698