[libcamera-devel] [PATCH v3 07/17] py: Set EFD_CLOEXEC on eventfd to avoid fd leaking

Laurent Pinchart laurent.pinchart at ideasonboard.com
Thu Aug 18 17:37:59 CEST 2022


Hi Tomi,

Thank you for the patch.

On Fri, Jul 01, 2022 at 11:45:11AM +0300, Tomi Valkeinen wrote:
> Set EFD_CLOEXEC on eventfd to avoid fd leaking.
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen at ideasonboard.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

> ---
>  src/py/libcamera/py_camera_manager.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/py/libcamera/py_camera_manager.cpp b/src/py/libcamera/py_camera_manager.cpp
> index 51a890c8..3d422c9e 100644
> --- a/src/py/libcamera/py_camera_manager.cpp
> +++ b/src/py/libcamera/py_camera_manager.cpp
> @@ -22,7 +22,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");

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list