summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2011-03-30 08:46:22 +0200
committerJim Meyering <meyering@redhat.com>2011-03-30 08:46:22 +0200
commitdc44690985e727ac2ef5af783a495a369223ab69 (patch)
tree4c61cffa878023ef01a7ac46655b4ccfa2f50660 /tests
parent0e91303ba89db46958de61bcc0e9680188b00377 (diff)
downloadgnulib-dc44690985e727ac2ef5af783a495a369223ab69.tar.gz
tests: readlink* ("",... fails with EINVAL on newer kernels
readlink and readlinkat have typically failed with ENOENT for the invalid, empty file name, "". However, with the advent of linux-2.6.39, they fail with EINVAL. * tests/test-areadlink.h (test_areadlink): Also accept EINVAL when operating on the empty file name. * tests/test-readlink.h (test_readlink): Likewise.
Diffstat (limited to 'tests')
-rw-r--r--tests/test-areadlink.h2
-rw-r--r--tests/test-readlink.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/test-areadlink.h b/tests/test-areadlink.h
index c7d8324048..55b41c038e 100644
--- a/tests/test-areadlink.h
+++ b/tests/test-areadlink.h
@@ -36,7 +36,7 @@ test_areadlink (char * (*func) (char const *, size_t), bool print)
ASSERT (errno == ENOENT);
errno = 0;
ASSERT (func ("", 1) == NULL);
- ASSERT (errno == ENOENT);
+ ASSERT (errno == ENOENT || errno == EINVAL);
errno = 0;
ASSERT (func (".", 1) == NULL);
ASSERT (errno == EINVAL);
diff --git a/tests/test-readlink.h b/tests/test-readlink.h
index 08d5662afc..7247fc4c91 100644
--- a/tests/test-readlink.h
+++ b/tests/test-readlink.h
@@ -38,7 +38,7 @@ test_readlink (ssize_t (*func) (char const *, char *, size_t), bool print)
ASSERT (errno == ENOENT);
errno = 0;
ASSERT (func ("", buf, sizeof buf) == -1);
- ASSERT (errno == ENOENT);
+ ASSERT (errno == ENOENT || errno == EINVAL);
errno = 0;
ASSERT (func (".", buf, sizeof buf) == -1);
ASSERT (errno == EINVAL);