| Index: runtime/bin/eventhandler_linux.cc
|
| diff --git a/runtime/bin/eventhandler_linux.cc b/runtime/bin/eventhandler_linux.cc
|
| index ce99057561049538fed7657ba50e9087e48bdc49..7cd9e5140b743c4cafaddf7619ebf155a2f13031 100644
|
| --- a/runtime/bin/eventhandler_linux.cc
|
| +++ b/runtime/bin/eventhandler_linux.cc
|
| @@ -84,7 +84,14 @@ static void UpdateEpollInstance(intptr_t epoll_fd_, SocketData* sd) {
|
| sd->set_tracked_by_epoll(true);
|
| }
|
| if (status == -1) {
|
| - FATAL1("Failed updating epoll instance: %s", strerror(errno));
|
| + // Epoll does not accept the file descriptor. It could be due to
|
| + // already closed file descriptor, or unuspported devices, such
|
| + // as /dev/null. In such case, mark the file descriptor as closed,
|
| + // so dart will handle it accordingly.
|
| + sd->set_tracked_by_epoll(false);
|
| + sd->ShutdownRead();
|
| + sd->ShutdownWrite();
|
| + DartUtils::PostInt32(sd->port(), 1 << kCloseEvent);
|
| }
|
| }
|
| }
|
|
|