summary refs log tree commit diff
path: root/pkgs/tools/misc/findutils
diff options
context:
space:
mode:
authorDmitry Kalinkin <dmitry.kalinkin@gmail.com>2018-09-14 11:13:53 -0700
committerDmitry Kalinkin <dmitry.kalinkin@gmail.com>2018-09-14 15:53:50 -0400
commitef04b4f283317d02397ce6546ef66868d59f45f3 (patch)
tree46936af5c5ff708ca1e7bb4bf33724e5da58f2ab /pkgs/tools/misc/findutils
parentaea9db9d5044b56925b968972b1c044c46b5bf71 (diff)
findutils: disable a bogus test
Diffstat (limited to 'pkgs/tools/misc/findutils')
-rw-r--r--pkgs/tools/misc/findutils/default.nix8
-rw-r--r--pkgs/tools/misc/findutils/disable-getdtablesize-test.patch25
2 files changed, 32 insertions, 1 deletions
diff --git a/pkgs/tools/misc/findutils/default.nix b/pkgs/tools/misc/findutils/default.nix
index d6eca100411bc..e7c507903190b 100644
--- a/pkgs/tools/misc/findutils/default.nix
+++ b/pkgs/tools/misc/findutils/default.nix
@@ -10,7 +10,13 @@ stdenv.mkDerivation rec {
     sha256 = "178nn4dl7wbcw499czikirnkniwnx36argdnqgz4ik9i6zvwkm6y";
   };
 
-  patches = [ ./memory-leak.patch ./no-install-statedir.patch ];
+  patches = [
+    ./memory-leak.patch
+    ./no-install-statedir.patch
+
+    # prevent tests from failing on old kernels
+    ./disable-getdtablesize-test.patch
+  ];
 
   buildInputs = [ coreutils ]; # bin/updatedb script needs to call sort
 
diff --git a/pkgs/tools/misc/findutils/disable-getdtablesize-test.patch b/pkgs/tools/misc/findutils/disable-getdtablesize-test.patch
new file mode 100644
index 0000000000000..611df364b6874
--- /dev/null
+++ b/pkgs/tools/misc/findutils/disable-getdtablesize-test.patch
@@ -0,0 +1,25 @@
+diff --git a/tests/test-dup2.c b/tests/test-dup2.c
+--- a/tests/test-dup2.c
++++ b/tests/test-dup2.c
+@@ -157,8 +157,6 @@ main (void)
+       ASSERT (close (255) == 0);
+       ASSERT (close (256) == 0);
+     }
+-  ASSERT (dup2 (fd, bad_fd - 1) == bad_fd - 1);
+-  ASSERT (close (bad_fd - 1) == 0);
+   errno = 0;
+   ASSERT (dup2 (fd, bad_fd) == -1);
+   ASSERT (errno == EBADF);
+diff --git a/tests/test-getdtablesize.c b/tests/test-getdtablesize.c
+index a0325af..a83f8ec 100644
+--- a/tests/test-getdtablesize.c
++++ b/tests/test-getdtablesize.c
+@@ -29,8 +29,6 @@ int
+ main (int argc, char *argv[])
+ {
+   ASSERT (getdtablesize () >= 3);
+-  ASSERT (dup2 (0, getdtablesize() - 1) == getdtablesize () - 1);
+-  ASSERT (dup2 (0, getdtablesize()) == -1);
+ 
+   return 0;
+ }