OSDN Git Service

Use EPOLLWAKEUP properly.
authorTim Kilbourn <tkilbourn@google.com>
Thu, 26 Mar 2015 21:12:42 +0000 (14:12 -0700)
committerTim Kilbourn <tkilbourn@google.com>
Thu, 26 Mar 2015 21:12:42 +0000 (14:12 -0700)
We were trying to use it only when it wasn't supported.

Bug: 19937342
Change-Id: Id35aef9ad84f101f7ada2eb87fb91e5c5e2b3357

services/inputflinger/EventHub.cpp

index 93ce010..3135692 100644 (file)
@@ -1293,7 +1293,10 @@ status_t EventHub::openDeviceLocked(const char *devicePath) {
     // Register with epoll.
     struct epoll_event eventItem;
     memset(&eventItem, 0, sizeof(eventItem));
-    eventItem.events = mUsingEpollWakeup ? EPOLLIN : EPOLLIN | EPOLLWAKEUP;
+    eventItem.events = EPOLLIN;
+    if (mUsingEpollWakeup) {
+        eventItem.events |= EPOLLWAKEUP;
+    }
     eventItem.data.u32 = deviceId;
     if (epoll_ctl(mEpollFd, EPOLL_CTL_ADD, fd, &eventItem)) {
         ALOGE("Could not add device fd to epoll instance.  errno=%d", errno);