File 0002-Replace-stat-fstat-calls-with-__xstat-__fxstat.patch of Package v4l-utils

From 523d2b060f9d7cf340baa0615443e3fae7f25555 Mon Sep 17 00:00:00 2001
From: Matt Madison <matt@madison.systems>
Date: Sun, 11 Apr 2021 06:48:54 -0700
Subject: [PATCH] Replace stat/fstat calls with __xstat/__fxstat

The stat-family syscalls were reworked in
glibc 2.33, so make the libv4lconvert plugin
compatible with the older glibc used in L4T
containers.

Signed-off-by: Matt Madison <matt@madison.systems>
---
 lib/libv4lconvert/control/libv4lcontrol.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/libv4lconvert/control/libv4lcontrol.c b/lib/libv4lconvert/control/libv4lcontrol.c
index 0b0a346..5643dbe 100644
--- a/lib/libv4lconvert/control/libv4lcontrol.c
+++ b/lib/libv4lconvert/control/libv4lcontrol.c
@@ -370,10 +370,10 @@ static int v4lcontrol_get_usb_info(struct v4lcontrol_data *data,
 	    "%s/sys/class/video4linux", sysfs_prefix);
 
 	/* Check for sysfs mounted before trying to search */
-	if (stat(sysfs_name, &st) != 0)
+	if (__xstat(0, sysfs_name, &st) != 0)
 		return 0; /* Not found, sysfs not mounted? */
 
-	if (fstat(data->fd, &st) || !S_ISCHR(st.st_mode))
+	if (__fxstat(0, data->fd, &st) || !S_ISCHR(st.st_mode))
 		return 0; /* Should never happen */
 
 	/* <Sigh> find ourselve in sysfs */
openSUSE Build Service is sponsored by