Index: runtime/bin/eventhandler_macos.cc |
diff --git a/runtime/bin/eventhandler_macos.cc b/runtime/bin/eventhandler_macos.cc |
index fac8941cc34311934b2e56a04e82ddc22ca97946..c884e587557fdf0e6b765b3b0bcc33bed2c108bd 100644 |
--- a/runtime/bin/eventhandler_macos.cc |
+++ b/runtime/bin/eventhandler_macos.cc |
@@ -227,9 +227,13 @@ void EventHandlerImplementation::HandleInterruptFd() { |
socket_map_.Remove(GetHashmapKeyFromFd(fd), GetHashmapHashFromFd(fd)); |
delete sd; |
} else { |
- // Setup events to wait for. |
- sd->SetPortAndMask(msg.dart_port, msg.data); |
- UpdateKqueue(kqueue_fd_, sd); |
+ if ((msg.data & (1 << kInEvent)) != 0 && sd->IsClosedRead()) { |
+ DartUtils::PostInt32(msg.dart_port, 1 << kCloseEvent); |
+ } else { |
+ // Setup events to wait for. |
+ sd->SetPortAndMask(msg.dart_port, msg.data); |
+ UpdateKqueue(kqueue_fd_, sd); |
+ } |
} |
} |
} |