diff options
author | Paul Elder <paul.elder@ideasonboard.com> | 2020-06-09 14:38:33 +0900 |
---|---|---|
committer | Paul Elder <paul.elder@ideasonboard.com> | 2020-06-17 15:10:02 +0900 |
commit | 469a85f74d631a83e325982d4101909e5e0a7834 (patch) | |
tree | b165d19dc498d78bed79028665b19638837850e3 /src/v4l2/v4l2_camera.cpp | |
parent | 967f77054cfe7828a4dba9fb4fad2d35b5c3882b (diff) |
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>
Diffstat (limited to 'src/v4l2/v4l2_camera.cpp')
-rw-r--r-- | src/v4l2/v4l2_camera.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/v4l2/v4l2_camera.cpp b/src/v4l2/v4l2_camera.cpp index 3c369328..9a1ebc84 100644 --- a/src/v4l2/v4l2_camera.cpp +++ b/src/v4l2/v4l2_camera.cpp @@ -91,7 +91,9 @@ void V4L2Camera::requestComplete(Request *request) bufferLock_.unlock(); uint64_t data = 1; - ::write(efd_, &data, sizeof(data)); + int ret = ::write(efd_, &data, sizeof(data)); + if (ret != sizeof(data)) + LOG(V4L2Compat, Error) << "Failed to signal eventfd POLLIN"; bufferSema_.release(); } |