summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>2022-08-19 14:16:13 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-08-19 15:44:24 +0300
commitdfa86000a63f8d94399a28e5432e445239526389 (patch)
tree243c10213189f87d7fb2854e7525477b3efa1958
parentf4933ee77f40b4861f2dd513b913065ac1bad96f (diff)
py: Set EFD_CLOEXEC on eventfd to avoid fd leaking
Set EFD_CLOEXEC on eventfd to avoid fd leaking. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rw-r--r--src/py/libcamera/py_camera_manager.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/py/libcamera/py_camera_manager.cpp b/src/py/libcamera/py_camera_manager.cpp
index 18fdb623..8bfb8e57 100644
--- a/src/py/libcamera/py_camera_manager.cpp
+++ b/src/py/libcamera/py_camera_manager.cpp
@@ -24,7 +24,7 @@ PyCameraManager::PyCameraManager()
cameraManager_ = std::make_unique<CameraManager>();
- int fd = eventfd(0, 0);
+ int fd = eventfd(0, EFD_CLOEXEC);
if (fd == -1)
throw std::system_error(errno, std::generic_category(),
"Failed to create eventfd");