[libcamera-devel] [PATCH 4/4] vimc: fix close(-1)

Laurent Pinchart laurent.pinchart at ideasonboard.com
Wed Oct 7 15:31:23 CEST 2020


Hi Tomi,

Thank you for the patch.

On Wed, Oct 07, 2020 at 12:22:39PM +0300, Tomi Valkeinen wrote:
> ~IPAVimc() checks if fd != 0, but it should check if fd != -1.
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen at iki.fi>

We should use the FileDeescriptor class to handle file descriptors. But
this code will be reworked anyway, so for now,

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

> ---
>  src/ipa/vimc/vimc.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/ipa/vimc/vimc.cpp b/src/ipa/vimc/vimc.cpp
> index ef25776..372a15f 100644
> --- a/src/ipa/vimc/vimc.cpp
> +++ b/src/ipa/vimc/vimc.cpp
> @@ -61,7 +61,7 @@ IPAVimc::IPAVimc()
>  
>  IPAVimc::~IPAVimc()
>  {
> -	if (fd_)
> +	if (fd_ != -1)
>  		::close(fd_);
>  }
>  

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list