From 58a19b9d56e5002367794ef0d2e9cf8dcd8d0be5 Mon Sep 17 00:00:00 2001 From: Paul Elder Date: Fri, 6 Dec 2019 04:09:32 -0500 Subject: libcamera: v4l2_device, v4l2_videodevice: call open system call directly We are preparing to integrate the V4L2 adaptation layer, which will intercept open() calls (among others) via LD_PRELOAD. To prevent libcamera's own open() calls from being intercepted, replace them with a direct syscall. Signed-off-by: Paul Elder Reviewed-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- src/libcamera/v4l2_device.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/libcamera/v4l2_device.cpp') diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp index 0452f801..c13eddc8 100644 --- a/src/libcamera/v4l2_device.cpp +++ b/src/libcamera/v4l2_device.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include "log.h" @@ -75,7 +76,7 @@ int V4L2Device::open(unsigned int flags) return -EBUSY; } - int ret = ::open(deviceNode_.c_str(), flags); + int ret = syscall(SYS_openat, AT_FDCWD, deviceNode_.c_str(), flags); if (ret < 0) { ret = -errno; LOG(V4L2, Error) << "Failed to open V4L2 device: " -- cgit v1.2.1