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
diff --git a/minui/events.c b/minui/events.c
index df7dad4..b8cf15a 100644
--- a/minui/events.c
+++ b/minui/events.c
@@ -84,7 +84,11 @@
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 @@
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) {