From: Bruno Haible Date: Sat, 15 Dec 2018 23:34:25 +0000 (+0100) Subject: openat-safer tests: Avoid test failure on NetBSD 8. X-Git-Tag: v1.0~5233 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=94672fc64e9c7b278ea3b1b75c902bf5756ae5e8;p=gnulib.git openat-safer tests: Avoid test failure on NetBSD 8. * tests/test-openat-safer.c (main): Execute a Linux specific test only on Linux. --- diff --git a/ChangeLog b/ChangeLog index e86bbd6cfa..533eb76177 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2018-12-15 Bruno Haible + + 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 regex: work around a bug in glibc-2.27 and prior 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);