Mercurial > gnulib
changeset 40030:41dc174470c2
openat-safer tests: Avoid test failure on NetBSD 8.
* tests/test-openat-safer.c (main): Execute a Linux specific test only
on Linux.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sun, 16 Dec 2018 00:34:25 +0100 |
parents | 6160efb8efef |
children | 49522e0c0097 |
files | ChangeLog tests/test-openat-safer.c |
diffstat | 2 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Sat Dec 15 15:24:21 2018 -0800 +++ b/ChangeLog Sun Dec 16 00:34:25 2018 +0100 @@ -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
--- a/tests/test-openat-safer.c Sat Dec 15 15:24:21 2018 -0800 +++ b/tests/test-openat-safer.c Sun Dec 16 00:34:25 2018 +0100 @@ -96,9 +96,11 @@ 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);