| Index: runtime/bin/eventhandler_macos.cc
|
| diff --git a/runtime/bin/eventhandler_macos.cc b/runtime/bin/eventhandler_macos.cc
|
| index a6554c9fc7e33b21045b780ee271243b2c82ed01..3008e4712cec52246fa48a825689b65af1732875 100644
|
| --- a/runtime/bin/eventhandler_macos.cc
|
| +++ b/runtime/bin/eventhandler_macos.cc
|
| @@ -235,7 +235,12 @@ void EventHandlerImplementation::HandleInterruptFd() {
|
| // Close the socket and free system resources.
|
| RemoveFromKqueue(kqueue_fd_, sd);
|
| intptr_t fd = sd->fd();
|
| - sd->Close();
|
| + if (fd == STDOUT_FILENO) {
|
| + // If stdout, redirect fd to /dev/null.
|
| + USE(dup2(open("/dev/null", O_WRONLY), STDOUT_FILENO));
|
| + } else {
|
| + sd->Close();
|
| + }
|
| socket_map_.Remove(GetHashmapKeyFromFd(fd), GetHashmapHashFromFd(fd));
|
| delete sd;
|
| } else {
|
|
|