Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Side by Side Diff: runtime/bin/eventhandler_linux.cc

Issue 12319067: Handle legacy epoll event on Linux. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/standalone/standalone.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "platform/globals.h" 5 #include "platform/globals.h"
6 #if defined(TARGET_OS_LINUX) 6 #if defined(TARGET_OS_LINUX)
7 7
8 #include "bin/eventhandler.h" 8 #include "bin/eventhandler.h"
9 9
10 #include <errno.h> // NOLINT 10 #include <errno.h> // NOLINT
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 } 317 }
318 318
319 if ((events & EPOLLOUT) != 0) { 319 if ((events & EPOLLOUT) != 0) {
320 if ((events & EPOLLERR) != 0) { 320 if ((events & EPOLLERR) != 0) {
321 event_mask = (1 << kErrorEvent); 321 event_mask = (1 << kErrorEvent);
322 sd->MarkClosedWrite(); 322 sd->MarkClosedWrite();
323 } else { 323 } else {
324 event_mask |= (1 << kOutEvent); 324 event_mask |= (1 << kOutEvent);
325 } 325 }
326 } 326 }
327
328 if (events == (EPOLLHUP | EPOLLERR)) {
Søren Gjesse 2013/02/22 09:29:06 So we still never get EPOLLHUP all alone on socket
Anders Johnsen 2013/02/22 09:33:18 Added.
329 event_mask = (1 << kErrorEvent);
330 sd->MarkClosedWrite();
331 sd->MarkClosedRead();
332 }
327 } 333 }
328 334
329 return event_mask; 335 return event_mask;
330 } 336 }
331 337
332 338
333 void EventHandlerImplementation::HandleEvents(struct epoll_event* events, 339 void EventHandlerImplementation::HandleEvents(struct epoll_event* events,
334 int size) { 340 int size) {
335 for (int i = 0; i < size; i++) { 341 for (int i = 0; i < size; i++) {
336 if (events[i].data.ptr != NULL) { 342 if (events[i].data.ptr != NULL) {
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 return reinterpret_cast<void*>(fd + 1); 431 return reinterpret_cast<void*>(fd + 1);
426 } 432 }
427 433
428 434
429 uint32_t EventHandlerImplementation::GetHashmapHashFromFd(intptr_t fd) { 435 uint32_t EventHandlerImplementation::GetHashmapHashFromFd(intptr_t fd) {
430 // The hashmap does not support keys with value 0. 436 // The hashmap does not support keys with value 0.
431 return dart::Utils::WordHash(fd + 1); 437 return dart::Utils::WordHash(fd + 1);
432 } 438 }
433 439
434 #endif // defined(TARGET_OS_LINUX) 440 #endif // defined(TARGET_OS_LINUX)
OLDNEW
« no previous file with comments | « no previous file | tests/standalone/standalone.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698