summaryrefslogtreecommitdiff
path: root/tests/test-openat-safer.c
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2018-12-16 00:34:25 +0100
committerBruno Haible <bruno@clisp.org>2018-12-16 00:35:44 +0100
commit94672fc64e9c7b278ea3b1b75c902bf5756ae5e8 (patch)
tree7182aff7d21321969db4530fed74f09b5669e1e6 /tests/test-openat-safer.c
parent55a4abd92a0a8fa0a9d9aff3892505f7b0c6d73c (diff)
downloadgnulib-94672fc64e9c7b278ea3b1b75c902bf5756ae5e8.tar.gz
openat-safer tests: Avoid test failure on NetBSD 8.
* tests/test-openat-safer.c (main): Execute a Linux specific test only on Linux.
Diffstat (limited to 'tests/test-openat-safer.c')
-rw-r--r--tests/test-openat-safer.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/test-openat-safer.c b/tests/test-openat-safer.c
index e8977e40be..8debf41476 100644
--- a/tests/test-openat-safer.c
+++ b/tests/test-openat-safer.c
@@ -96,9 +96,11 @@ main (void)
errno = 0;
ASSERT (openat (dfd, witness "/", O_RDONLY) == -1);
ASSERT (errno == ENOTDIR || errno == EISDIR || errno == EINVAL);
+#ifdef __linux__
/* Using a bad directory is okay for absolute paths. */
fd = openat (-1, "/dev/null", O_WRONLY);
ASSERT (STDERR_FILENO < fd);
+#endif
/* Using a non-directory is wrong for relative paths. */
errno = 0;
ASSERT (openat (fd, ".", O_RDONLY) == -1);