Chromium Code Reviews| Index: runtime/bin/eventhandler_android.cc |
| diff --git a/runtime/bin/eventhandler_android.cc b/runtime/bin/eventhandler_android.cc |
| index bbc8acbc8bec5ea726fc780a7cb6b62bb49d7e20..b716623b67c8aaad1e019c2590a892b8059e5ace 100644 |
| --- a/runtime/bin/eventhandler_android.cc |
| +++ b/runtime/bin/eventhandler_android.cc |
| @@ -215,7 +215,12 @@ void EventHandlerImplementation::HandleInterruptFd() { |
| // next message. |
| RemoveFromEpollInstance(epoll_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)); |
|
kustermann
2013/06/27 15:14:07
You leak one file descriptor here. I'd do somethin
Anders Johnsen
2013/06/27 16:32:07
You're right, thanks!
|
| + } else { |
|
Bill Hesse
2013/06/27 16:42:36
Shouldn't you be checking that dev/null didn't ope
Anders Johnsen
2013/06/27 16:44:11
No, it's still open at this point.
|
| + sd->Close(); |
| + } |
| socket_map_.Remove(GetHashmapKeyFromFd(fd), GetHashmapHashFromFd(fd)); |
| delete sd; |
| } else { |