mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-19 02:15:05 +03:00
v4l2: v4l2_camera_proxy, v4l2_camera: Check return values of read/write
The return value of the write to the eventfd (to signal POLLIN) from V4L2Camera and the read from the eventfd (to clear POLLIN) from V4L2CameraProxy was ignored. Check the return value, and print an error message. Reported-by: Coverity CID=290743 Reported-by: Coverity CID=290744 Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
967f77054c
commit
469a85f74d
2 changed files with 6 additions and 2 deletions
|
@ -454,7 +454,9 @@ int V4L2CameraProxy::vidioc_dqbuf(struct v4l2_buffer *arg)
|
|||
currentBuf_ = (currentBuf_ + 1) % bufferCount_;
|
||||
|
||||
uint64_t data;
|
||||
::read(efd_, &data, sizeof(data));
|
||||
int ret = ::read(efd_, &data, sizeof(data));
|
||||
if (ret != sizeof(data))
|
||||
LOG(V4L2Compat, Error) << "Failed to clear eventfd POLLIN";
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue