| Index: runtime/bin/eventhandler_linux.cc
|
| diff --git a/runtime/bin/eventhandler_linux.cc b/runtime/bin/eventhandler_linux.cc
|
| index aa852d197e79c76ac34de41b0ba32f7c6c91b5d8..9ed591afcebf4be27620095bb8fb7766d6195db6 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
|
|
|
| #include "bin/dartutils.h"
|
| #include "bin/fdutils.h"
|
| @@ -223,7 +224,15 @@ 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.
|
| + int null_fd = TEMP_FAILURE_RETRY(open("/dev/null", O_WRONLY));
|
| + ASSERT(null_fd >= 0);
|
| + VOID_TEMP_FAILURE_RETRY(dup2(null_fd, STDOUT_FILENO));
|
| + VOID_TEMP_FAILURE_RETRY(close(null_fd));
|
| + } else {
|
| + sd->Close();
|
| + }
|
| socket_map_.Remove(GetHashmapKeyFromFd(fd), GetHashmapHashFromFd(fd));
|
| delete sd;
|
| } else {
|
|
|