]> Savannah Git Hosting - gnulib.git/commitdiff
openat-safer tests: Avoid test failure on NetBSD 8.
authorBruno Haible <bruno@clisp.org>
Sat, 15 Dec 2018 23:34:25 +0000 (00:34 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 15 Dec 2018 23:35:44 +0000 (00:35 +0100)
* tests/test-openat-safer.c (main): Execute a Linux specific test only
on Linux.

ChangeLog
tests/test-openat-safer.c

index e86bbd6cfa8a18de8790044aaf4e2dd05333fb2e..533eb7617732b119fb066754d2870de4a91337a0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2018-12-15  Bruno Haible  <bruno@clisp.org>
+
+       openat-safer tests: Avoid test failure on NetBSD 8.
+       * tests/test-openat-safer.c (main): Execute a Linux specific test only
+       on Linux.
+
 2018-12-15  Jim Meyering  <meyering@fb.com>
 
        regex: work around a bug in glibc-2.27 and prior
index e8977e40be026a44360e821b529e143818cc7d3f..8debf41476846a2f3fffb77e1162e6158f3d502b 100644 (file)
@@ -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);