]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
reallocarray tests: Avoid test failure on NetBSD.
authorBruno Haible <bruno@clisp.org>
Thu, 13 May 2021 10:11:04 +0000 (12:11 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 13 May 2021 10:11:04 +0000 (12:11 +0200)
* tests/test-reallocarray.c (main): Accept EOVERFLOW error code.

ChangeLog
tests/test-reallocarray.c

index 0a1f3cc076a2e2e27a67881fa62206c511e84144..0bcb9e64850859b43e5f72ac9bd34be246347161 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2021-05-13  Bruno Haible  <bruno@clisp.org>
+
+       reallocarray tests: Avoid test failure on NetBSD.
+       * tests/test-reallocarray.c (main): Accept EOVERFLOW error code.
+
 2021-05-12  Bruno Haible  <bruno@clisp.org>
 
        gnulib-tool: Fail properly if the 'join' program is not found.
index 6de355e6bd3cb8280f70cdcea09ba57e29d2635c..8067542d5870fd01e75e059c7f92783cdc30894d 100644 (file)
@@ -41,7 +41,8 @@ main ()
       p = reallocarray (p, SIZE_MAX / n + 1, n);
       if (p)
         return 3;
-      if (errno != ENOMEM)
+      if (!(errno == ENOMEM
+            || errno == EOVERFLOW /* NetBSD */))
         return 4;
 
       /* Reallocarray should not crash with zero sizes.  */