Chromium Code Reviews| Index: runtime/bin/eventhandler_linux.cc |
| diff --git a/runtime/bin/eventhandler_linux.cc b/runtime/bin/eventhandler_linux.cc |
| index aa852d197e79c76ac34de41b0ba32f7c6c91b5d8..78c7b35e26a3e13f511dc0835109a2093c88d2fa 100644 |
| --- a/runtime/bin/eventhandler_linux.cc |
| +++ b/runtime/bin/eventhandler_linux.cc |
| @@ -14,6 +14,7 @@ |
| #include <sys/epoll.h> // NOLINT |
| #include <sys/stat.h> // NOLINT |
| #include <unistd.h> // NOLINT |
| +#include <fcntl.h> // NOLINT |
|
kustermann
2013/06/27 15:14:07
If you need this here, you probably also need it f
Anders Johnsen
2013/06/27 16:32:07
Done.
|
| #include "bin/dartutils.h" |
| #include "bin/fdutils.h" |
| @@ -223,7 +224,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)); |
| + } else { |
| + sd->Close(); |
| + } |
| socket_map_.Remove(GetHashmapKeyFromFd(fd), GetHashmapHashFromFd(fd)); |
| delete sd; |
| } else { |