Index: runtime/bin/eventhandler_macos.cc |
diff --git a/runtime/bin/eventhandler_macos.cc b/runtime/bin/eventhandler_macos.cc |
index ea0d5dabb2866648ba9f10732d388bf5dfaf65fc..7aa9280b2f58aae8efa5c8753e2fdfc9235e495d 100644 |
--- a/runtime/bin/eventhandler_macos.cc |
+++ b/runtime/bin/eventhandler_macos.cc |
@@ -389,13 +389,11 @@ void EventHandlerImplementation::HandleEvents(struct kevent* events, int size) { |
} else { |
DescriptorInfo* di = reinterpret_cast<DescriptorInfo*>(events[i].udata); |
const intptr_t old_mask = di->Mask(); |
- intptr_t event_mask = GetEvents(events + i, di); |
+ const intptr_t event_mask = GetEvents(events + i, di); |
if ((event_mask & (1 << kErrorEvent)) != 0) { |
di->NotifyAllDartPorts(event_mask); |
- } |
- event_mask &= ~(1 << kErrorEvent); |
- |
- if (event_mask != 0) { |
+ UpdateKQueueInstance(old_mask, di); |
+ } else if (event_mask != 0) { |
Dart_Port port = di->NextNotifyDartPort(event_mask); |
ASSERT(port != 0); |
UpdateKQueueInstance(old_mask, di); |