summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/libnvme/files/0001-mock.c-fix-checking-of-HAVE_GLIBC_IOCTL.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-support/libnvme/files/0001-mock.c-fix-checking-of-HAVE_GLIBC_IOCTL.patch')
-rw-r--r--meta-oe/recipes-support/libnvme/files/0001-mock.c-fix-checking-of-HAVE_GLIBC_IOCTL.patch41
1 files changed, 41 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/libnvme/files/0001-mock.c-fix-checking-of-HAVE_GLIBC_IOCTL.patch b/meta-oe/recipes-support/libnvme/files/0001-mock.c-fix-checking-of-HAVE_GLIBC_IOCTL.patch
new file mode 100644
index 0000000000..8734d443bb
--- /dev/null
+++ b/meta-oe/recipes-support/libnvme/files/0001-mock.c-fix-checking-of-HAVE_GLIBC_IOCTL.patch
@@ -0,0 +1,41 @@
1From 14328a9a429fd84ddd1a3ed4fb0eb9643c61fa58 Mon Sep 17 00:00:00 2001
2From: Changqing Li <changqing.li@windriver.com>
3Date: Mon, 7 Apr 2025 13:23:57 +0800
4Subject: [PATCH] mock.c: fix checking of HAVE_GLIBC_IOCTL
5
6Commit [ 0d8d0a55 build: do not include config.h globally ]
7changed to always pass -DHAVE_GLIBC_IOCTL=[0|1], and this causes
8a regression, for system without glibc ioctl, -DHAVE_GLIBC_IOCTL=0
9is passed, and causes error:
10../git/test/ioctl/mock.c:123:5: error: conflicting types for 'ioctl'; have 'int(int, long unsigned int, ...)'
11 123 | int ioctl(int fd, unsigned long request, ...)
12 | ^~~~~
13In file included from ../git/test/ioctl/mock.c:9:
14pathto/usr/include/sys/ioctl.h:115:5: note: previous declaration of 'ioctl' with type 'int(int, int, ...)'
15 115 | int ioctl (int, int, ...);
16
17Fixed by checking value of HAVE_GLIBC_IOCTL in mock.c
18
19Upstream-Status: Submitted [https://github.com/linux-nvme/libnvme/pull/985]
20
21Signed-off-by: Changqing Li <changqing.li@windriver.com>
22---
23 test/ioctl/mock.c | 2 +-
24 1 file changed, 1 insertion(+), 1 deletion(-)
25
26diff --git a/test/ioctl/mock.c b/test/ioctl/mock.c
27index 7402b45c..da3caba8 100644
28--- a/test/ioctl/mock.c
29+++ b/test/ioctl/mock.c
30@@ -118,7 +118,7 @@ void end_mock_cmds(void)
31 } \
32 })
33
34-#ifdef HAVE_GLIBC_IOCTL
35+#if defined(HAVE_GLIBC_IOCTL) && HAVE_GLIBC_IOCTL == 1
36 typedef int (*ioctl_func_t)(int, unsigned long, void *);
37 int ioctl(int fd, unsigned long request, ...)
38 #else
39--
402.34.1
41