Skip to content

Commit 4a7a0a0

Browse files
authored
Use <fcntl.h> instead of <sys/fcntl.h>
When building on musl, we get: ``` In file included from tests/zfs-tests/cmd/getversion.c:22: /usr/include/sys/fcntl.h:1:2: error: #warning redirecting incorrect #include <sys/fcntl.h> to <fcntl.h> [-Werror=cpp] 1 | #warning redirecting incorrect #include <sys/fcntl.h> to <fcntl.h> In file included from module/os/linux/zfs/vdev_file.c:36: /usr/include/sys/fcntl.h:1:2: error: #warning redirecting incorrect #include <sys/fcntl.h> to <fcntl.h> [-Werror=cpp] 1 | #warning redirecting incorrect #include <sys/fcntl.h> to <fcntl.h> ``` Bug: https://bugs.gentoo.org/925235 Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Sam James <[email protected]> Closes #15925
1 parent 187f931 commit 4a7a0a0

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

module/os/linux/zfs/vdev_file.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@
3333
#include <sys/fs/zfs.h>
3434
#include <sys/fm/fs/zfs.h>
3535
#include <sys/abd.h>
36-
#include <sys/fcntl.h>
3736
#include <sys/vnode.h>
3837
#include <sys/zfs_file.h>
3938
#ifdef _KERNEL
4039
#include <linux/falloc.h>
40+
#include <sys/fcntl.h>
41+
#else
42+
#include <fcntl.h>
4143
#endif
4244
/*
4345
* Virtual device vector for files.

tests/zfs-tests/cmd/getversion.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
*/
2020

2121
#include <sys/ioctl.h>
22-
#include <sys/fcntl.h>
2322
#include <linux/fs.h>
2423
#include <err.h>
24+
#include <fcntl.h>
2525
#include <stdio.h>
2626
#include <stdlib.h>
2727
#include <unistd.h>

0 commit comments

Comments
 (0)