[libcamera-devel] [PATCH] libcamera: frame_buffer: Print errno on mmap() failure
Umang Jain
umang.jain at ideasonboard.com
Mon Aug 9 18:04:45 CEST 2021
In mmap() error handling path, errno is stored but never printed
in the error log. Print it.
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_);
break;
}
--
2.31.1
More information about the libcamera-devel
mailing list