[libcamera-devel] [PATCH] libcamera: frame_buffer: Print errno on mmap() failure
Kieran Bingham
kieran.bingham at ideasonboard.com
Tue Aug 10 10:29:14 CEST 2021
Hi Umang,
On 09/08/2021 17:04, Umang Jain wrote:
> In mmap() error handling path, errno is stored but never printed
> in the error log. Print it.
Good spot...
> Signed-off-by: Umang Jain <umang.jain at ideasonboard.com>
> ---
> src/libcamera/framebuffer.cpp | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/libcamera/framebuffer.cpp b/src/libcamera/framebuffer.cpp
> index 41e6e68f..280f64c6 100644
> --- a/src/libcamera/framebuffer.cpp
> +++ b/src/libcamera/framebuffer.cpp
> @@ -388,7 +388,8 @@ MappedFrameBuffer::MappedFrameBuffer(const FrameBuffer *buffer, int flags)
> MAP_SHARED, plane.fd.fd(), 0);
> if (address == MAP_FAILED) {
> error_ = -errno;
> - LOG(Buffer, Error) << "Failed to mmap plane";
> + LOG(Buffer, Error) << "Failed to mmap plane: "
> + << strerror(-error_);
Should we say which plane?
It may not matter - as it's just a fairly bad failure if we hit this.
Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
> break;
> }
>
>
More information about the libcamera-devel
mailing list