Merge "Use EPOLLWAKEUP properly."

This commit is contained in:
Tim Kilbourn 2015-03-27 16:24:15 +00:00 committed by Android (Google) Code Review
commit 62535f0936

View 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);