Skip to content

Commit 8477f03

Browse files
sandy-lcqigaw
authored andcommitted
mock.c: fix checking of HAVE_GLIBC_IOCTL
Commit [ 0d8d0a5 build: do not include config.h globally ] changed to always pass -DHAVE_GLIBC_IOCTL=[0|1], and this causes a regression, for system without glibc ioctl, -DHAVE_GLIBC_IOCTL=0 is passed, and causes error: ../git/test/ioctl/mock.c:123:5: error: conflicting types for 'ioctl'; have 'int(int, long unsigned int, ...)' 123 | int ioctl(int fd, unsigned long request, ...) | ^~~~~ In file included from ../git/test/ioctl/mock.c:9: pathto/usr/include/sys/ioctl.h:115:5: note: previous declaration of 'ioctl' with type 'int(int, int, ...)' 115 | int ioctl (int, int, ...); Fixed by checking value of HAVE_GLIBC_IOCTL in mock.c Signed-off-by: Changqing Li <changqing.li@windriver.com>
1 parent 89ac31f commit 8477f03

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/ioctl/mock.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ void end_mock_cmds(void)
118118
} \
119119
})
120120

121-
#ifdef HAVE_GLIBC_IOCTL
121+
#if defined(HAVE_GLIBC_IOCTL) && HAVE_GLIBC_IOCTL == 1
122122
typedef int (*ioctl_func_t)(int, unsigned long, void *);
123123
int ioctl(int fd, unsigned long request, ...)
124124
#else

0 commit comments

Comments
 (0)