diff options
author | Richard Yao <[email protected]> | 2017-04-08 12:51:04 -0400 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2017-04-12 08:58:09 -0700 |
commit | 120ff39a75ad52efc359308a5e128a58998dd2f3 (patch) | |
tree | 1af0e21a6939a6e5d4d97ce0f342036b7072f854 /tests/zfs-tests/cmd | |
parent | 281f1fa30ac3558d0e5e1573bdb9113291815bcd (diff) |
Fix header inclusions for standards conformance
musl's sys/errno.h is literally:
/#warning redirecting incorrect #include <sys/errno.h> to <errno.h>
/#include <errno.h>
It does the same for sys/{poll,signal}.h. This is rather noisy when
building ZoL against musl. musl is also correct in pointing out that the
correct headers are outside of sys/ according to the single unix
specification:
http://pubs.opengroup.org/onlinepubs/7908799/xsh/errno.h.html
http://pubs.opengroup.org/onlinepubs/7908799/xsh/poll.h.html
http://pubs.opengroup.org/onlinepubs/7908799/xsh/signal.h.html
Lets implement our own sys/* versions of these headers to redirect to
the proper userland ones when building in userspace. That will silence
the warning.
There are also some instances where we include incorrectly from sys/ or
from outside of sys/ in userspace only code. In these instances, lets
just fix the includes directly.
Reviewed-by: George Melikov <[email protected]>
Reviewed-by: loli10K <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: George Melikov <[email protected]>
Signed-off-by: Richard Yao <[email protected]>
Closes #5993
Diffstat (limited to 'tests/zfs-tests/cmd')
-rw-r--r-- | tests/zfs-tests/cmd/file_trunc/file_trunc.c | 2 | ||||
-rw-r--r-- | tests/zfs-tests/cmd/mktree/mktree.c | 2 |
2 files changed, 1 insertions, 3 deletions
diff --git a/tests/zfs-tests/cmd/file_trunc/file_trunc.c b/tests/zfs-tests/cmd/file_trunc/file_trunc.c index 38e36c9d4..f9431300b 100644 --- a/tests/zfs-tests/cmd/file_trunc/file_trunc.c +++ b/tests/zfs-tests/cmd/file_trunc/file_trunc.c @@ -35,10 +35,8 @@ #include <errno.h> #include <fcntl.h> #include <sys/types.h> -#include <sys/fcntl.h> #include <sys/stat.h> #include <sys/statvfs.h> -#include <sys/errno.h> #include <sys/time.h> #include <sys/ioctl.h> #include <sys/wait.h> diff --git a/tests/zfs-tests/cmd/mktree/mktree.c b/tests/zfs-tests/cmd/mktree/mktree.c index 95d31a652..3dc3dd8ec 100644 --- a/tests/zfs-tests/cmd/mktree/mktree.c +++ b/tests/zfs-tests/cmd/mktree/mktree.c @@ -24,6 +24,7 @@ * Use is subject to license terms. */ +#include <errno.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> @@ -32,7 +33,6 @@ #include <attr/xattr.h> #include <sys/stat.h> #include <sys/types.h> -#include <sys/errno.h> #include <sys/param.h> #define TYPE_D 'D' |