From 383baf8794ebbdb81dff24b7d6f314e046f5d0cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sat, 15 Oct 2011 23:25:12 +0000 Subject: [PATCH] GNU M4: Have a test work around flaws in newer Linux versions. svn path=/nixpkgs/branches/stdenv-updates/; revision=29856 --- pkgs/development/tools/misc/gnum4/default.nix | 2 +- .../tools/misc/gnum4/readlink-EINVAL.patch | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/tools/misc/gnum4/readlink-EINVAL.patch diff --git a/pkgs/development/tools/misc/gnum4/default.nix b/pkgs/development/tools/misc/gnum4/default.nix index 47d8b51b82b..12cc50a37a0 100644 --- a/pkgs/development/tools/misc/gnum4/default.nix +++ b/pkgs/development/tools/misc/gnum4/default.nix @@ -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/; diff --git a/pkgs/development/tools/misc/gnum4/readlink-EINVAL.patch b/pkgs/development/tools/misc/gnum4/readlink-EINVAL.patch new file mode 100644 index 00000000000..dd371584a79 --- /dev/null +++ b/pkgs/development/tools/misc/gnum4/readlink-EINVAL.patch @@ -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);