summaryrefslogtreecommitdiff
path: root/src/v4l2/v4l2_camera_proxy.cpp
diff options
context:
space:
mode:
authorHirokazu Honda <hiroh@chromium.org>2021-06-10 16:50:27 +0900
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-12-04 23:05:05 +0200
commit3dc3e2e61e548e4cd3e213b1b3022ed4d8e7ecee (patch)
treea9c481bbbae584bf5b2806f9f346c6d4946325a5 /src/v4l2/v4l2_camera_proxy.cpp
parent1af788a8fb37bd5695b572bb3506409949c06485 (diff)
v4l2: v4l2_camera: Return int in getBufferFd()
V4L2Camera::getBufferFd() returns FileDescriptor. However, the file descriptor is still owned by V4L2Camera. It should rather return an integer to represent V4L2Camera doesn't have the ownership of the file descriptor. Signed-off-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/v4l2/v4l2_camera_proxy.cpp')
-rw-r--r--src/v4l2/v4l2_camera_proxy.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp
index 79bc880d..c1375777 100644
--- a/src/v4l2/v4l2_camera_proxy.cpp
+++ b/src/v4l2/v4l2_camera_proxy.cpp
@@ -114,14 +114,14 @@ void *V4L2CameraProxy::mmap(void *addr, size_t length, int prot, int flags,
return MAP_FAILED;
}
- FileDescriptor fd = vcam_->getBufferFd(index);
- if (!fd.isValid()) {
+ int fd = vcam_->getBufferFd(index);
+ if (fd < 0) {
errno = EINVAL;
return MAP_FAILED;
}
void *map = V4L2CompatManager::instance()->fops().mmap(addr, length, prot,
- flags, fd.fd(), 0);
+ flags, fd, 0);
if (map == MAP_FAILED)
return map;