GNU M4: Have a test work around flaws in newer Linux versions.

svn path=/nixpkgs/branches/stdenv-updates/; revision=29856
This commit is contained in:
Ludovic Courtès 2011-10-15 23:25:12 +00:00
parent 8dfef0f4a0
commit 383baf8794
2 changed files with 19 additions and 1 deletions

View File

@ -11,7 +11,7 @@ stdenv.mkDerivation {
doCheck = !stdenv.isDarwin;
# Upstream is aware of it; it may be in the next release.
patches = [ ./s_isdir.patch ];
patches = [ ./s_isdir.patch ./readlink-EINVAL.patch ];
meta = {
homepage = http://www.gnu.org/software/m4/;

View File

@ -0,0 +1,18 @@
Newer Linux kernels would return EINVAL instead of ENOENT.
The patch below, taken from Gnulib, allows the test to pass when
these Linux versions are in use:
https://lists.gnu.org/archive/html/bug-gnulib/2011-03/msg00308.html .
diff --git a/tests/test-readlink.h b/tests/test-readlink.h
index 08d5662..7247fc4 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);