From f47c91053ffb0c4477a6dc7271dae0b20b6223c3 Mon Sep 17 00:00:00 2001 From: Nick Kralevich Date: Mon, 17 Dec 2018 09:32:23 -0800 Subject: [PATCH] use epoll_create1(EPOLL_CLOEXEC) epoll_create(0) leaks file descriptors. Use epoll_create1(EPOLL_CLOEXEC) instead. Bug: 120983106 Test: compiles and boots Change-Id: I2a733d4482d6a74ceb3254e501cdb5f6de0cd5dc --- libappfuse/FuseBridgeLoop.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libappfuse/FuseBridgeLoop.cc b/libappfuse/FuseBridgeLoop.cc index 8b0c53eb2..ac94e6917 100644 --- a/libappfuse/FuseBridgeLoop.cc +++ b/libappfuse/FuseBridgeLoop.cc @@ -311,7 +311,7 @@ class BridgeEpollController : private EpollController { }; FuseBridgeLoop::FuseBridgeLoop() : opened_(true) { - base::unique_fd epoll_fd(epoll_create1(/* no flag */ 0)); + base::unique_fd epoll_fd(epoll_create1(EPOLL_CLOEXEC)); if (epoll_fd.get() == -1) { PLOG(ERROR) << "Failed to open FD for epoll"; opened_ = false;