From 452e420a2ec339592f5590abbc5dec4ea764521d Mon Sep 17 00:00:00 2001 From: Ethan Yonker Date: Thu, 11 Dec 2014 10:35:52 -0600 Subject: EPOLLWAKEUP handling in minui/events.c Older trees may not have EPOLLWAKEUP defined so we will work around the lack of EPOLLWAKEUP support as best we can. This should only maybe affect how charger handles waking up the screen in off mode charging in older trees. No impact on TWRP itself. Change-Id: Ia72ebfc12778b2bcda648edc27d2092c2ead415c --- minui/events.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'minui') diff --git a/minui/events.c b/minui/events.c index df7dad448..b8cf15ab4 100644 --- a/minui/events.c +++ b/minui/events.c @@ -84,7 +84,11 @@ int ev_init(ev_callback input_cb, void *data) continue; } +#ifdef EPOLLWAKEUP ev.events = EPOLLIN | EPOLLWAKEUP; +#else + ev.events = EPOLLIN; +#endif ev.data.ptr = (void *)&ev_fdinfo[ev_count]; if (epoll_ctl(epollfd, EPOLL_CTL_ADD, fd, &ev)) { close(fd); @@ -118,7 +122,11 @@ int ev_add_fd(int fd, ev_callback cb, void *data) if (ev_misc_count == MAX_MISC_FDS || cb == NULL) return -1; +#ifdef EPOLLWAKEUP ev.events = EPOLLIN | EPOLLWAKEUP; +#else + ev.events = EPOLLIN; +#endif ev.data.ptr = (void *)&ev_fdinfo[ev_count]; ret = epoll_ctl(epollfd, EPOLL_CTL_ADD, fd, &ev); if (!ret) { -- cgit v1.2.3