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>
This commit is contained in:
Tomi Valkeinen 2022-08-19 14:16:13 +03:00 committed by Laurent Pinchart
parent f4933ee77f
commit dfa86000a6

View file

@ -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");