From fcf1b2bcce9fd9d1997745d35c6ac36ddd2448a9 Mon Sep 17 00:00:00 2001 From: Nick Kralevich Date: Sat, 15 Dec 2018 11:59:30 -0800 Subject: use epoll_create1 epoll_create leaks file descriptors. Use epoll_create1(EPOLL_CLOEXEC) instead. Bug: 120983106 Test: compiles and boots Change-Id: I59cebb997de9d8b99804cc45a962751976d07ce6 --- services/inputflinger/EventHub.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'services/inputflinger/EventHub.cpp') diff --git a/services/inputflinger/EventHub.cpp b/services/inputflinger/EventHub.cpp index 4d9a2a0254..ccc24b950e 100644 --- a/services/inputflinger/EventHub.cpp +++ b/services/inputflinger/EventHub.cpp @@ -206,7 +206,7 @@ EventHub::EventHub(void) : mPendingEventCount(0), mPendingEventIndex(0), mPendingINotify(false) { acquire_wake_lock(PARTIAL_WAKE_LOCK, WAKE_LOCK_ID); - mEpollFd = epoll_create(EPOLL_SIZE_HINT); + mEpollFd = epoll_create1(EPOLL_CLOEXEC); LOG_ALWAYS_FATAL_IF(mEpollFd < 0, "Could not create epoll instance. errno=%d", errno); mINotifyFd = inotify_init(); -- cgit v1.2.3-59-g8ed1b