aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam James <[email protected]>2024-11-07 19:20:37 +0000
committerGitHub <[email protected]>2024-11-07 11:20:37 -0800
commit4a7a0a0290118382a2c7be320c6e14d72b0637a1 (patch)
tree5c674ad4477df2a12f5b789502ab40a6339dde6d
parent187f93137265feb2ea84f109168dffce2d91e7ef (diff)
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
-rw-r--r--module/os/linux/zfs/vdev_file.c4
-rw-r--r--tests/zfs-tests/cmd/getversion.c2
2 files changed, 4 insertions, 2 deletions
diff --git a/module/os/linux/zfs/vdev_file.c b/module/os/linux/zfs/vdev_file.c
index 4bffb6412..2cab65324 100644
--- a/module/os/linux/zfs/vdev_file.c
+++ b/module/os/linux/zfs/vdev_file.c
@@ -33,11 +33,13 @@
#include <sys/fs/zfs.h>
#include <sys/fm/fs/zfs.h>
#include <sys/abd.h>
-#include <sys/fcntl.h>
#include <sys/vnode.h>
#include <sys/zfs_file.h>
#ifdef _KERNEL
#include <linux/falloc.h>
+#include <sys/fcntl.h>
+#else
+#include <fcntl.h>
#endif
/*
* Virtual device vector for files.
diff --git a/tests/zfs-tests/cmd/getversion.c b/tests/zfs-tests/cmd/getversion.c
index 62c1c5b6a..1e026b92d 100644
--- a/tests/zfs-tests/cmd/getversion.c
+++ b/tests/zfs-tests/cmd/getversion.c
@@ -19,9 +19,9 @@
*/
#include <sys/ioctl.h>
-#include <sys/fcntl.h>
#include <linux/fs.h>
#include <err.h>
+#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>