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
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Sam James 2024-02-23 05:12:09 +00:00
parent af4da5ccf2
commit 2cb0a4e329
No known key found for this signature in database
GPG Key ID: 738409F520DF9190
2 changed files with 4 additions and 2 deletions

View File

@ -33,11 +33,13 @@
#include <sys/fs/zfs.h> #include <sys/fs/zfs.h>
#include <sys/fm/fs/zfs.h> #include <sys/fm/fs/zfs.h>
#include <sys/abd.h> #include <sys/abd.h>
#include <sys/fcntl.h>
#include <sys/vnode.h> #include <sys/vnode.h>
#include <sys/zfs_file.h> #include <sys/zfs_file.h>
#ifdef _KERNEL #ifdef _KERNEL
#include <linux/falloc.h> #include <linux/falloc.h>
#include <sys/fcntl.h>
#else
#include <fcntl.h>
#endif #endif
/* /*
* Virtual device vector for files. * Virtual device vector for files.

View File

@ -19,9 +19,9 @@
*/ */
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/fcntl.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <err.h> #include <err.h>
#include <fcntl.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>