| 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;
|
| }
|
|
|
|
|
|
|