Skip to content

Commit

Permalink
Use <fcntl.h> instead of <sys/fcntl.h>
Browse files Browse the repository at this point in the history
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>                                                                                                                     |  ^~~~~~~                                                                                                                                                                         cc1: all warnings being treated as errors
```

Bug: https://bugs.gentoo.org/925235
Signed-off-by: Sam James <[email protected]>
  • Loading branch information
thesamesam committed Feb 23, 2024
1 parent af4da5c commit 17c9384
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion module/os/linux/zfs/vdev_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* Copyright (c) 2011, 2020 by Delphix. All rights reserved.
*/

#include <fcntl.h>
#include <sys/zfs_context.h>
#include <sys/spa.h>
#include <sys/spa_impl.h>
Expand All @@ -33,7 +34,6 @@
#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
Expand Down
2 changes: 1 addition & 1 deletion tests/zfs-tests/cmd/getversion.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 17c9384

Please sign in to comment.