]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
tst-realloc: do not check for errno on success [BZ #22611]
authorAurelien Jarno <aurelien@aurel32.net>
Fri, 29 Dec 2017 13:44:57 +0000 (14:44 +0100)
committerAurelien Jarno <aurelien@aurel32.net>
Sun, 31 Dec 2017 20:21:27 +0000 (21:21 +0100)
POSIX explicitly says that applications should check errno only after
failure, so the errno value can be clobbered on success as long as it
is not set to zero.

Changelog:
[BZ #22611]
* malloc/tst-realloc.c (do_test): Remove the test checking that errno
is unchanged on success.
(cherry picked from commit f8aa69be445f65bb36cb3ae9291423600da7d6d2)

ChangeLog
malloc/tst-realloc.c

index 414e931aa500a737372e1aa51bd3a3ca03cb0116..2e6383b3dc9a038f6cbed10529dc34c728fe1653 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-12-29  Aurelien Jarno  <aurelien@aurel32.net>
+
+       [BZ #22611]
+       * malloc/tst-realloc.c (do_test): Remove the test checking that errno
+       is unchanged on success.
+
 2017-12-30  Aurelien Jarno  <aurelien@aurel32.net>
            Dmitry V. Levin  <ldv@altlinux.org>
 
index 31a58bd0260c3522e4c0f536cf6c9dd58f7c6414..d942c6e536f48aa1540c59ba687b4a717dc5580b 100644 (file)
@@ -66,10 +66,6 @@ do_test (void)
   if (p == NULL)
     merror ("realloc (NULL, 10) failed.");
 
-  /* errno should be clear on success (POSIX).  */
-  if (p != NULL && save != 0)
-    merror ("errno is set but should not be");
-
   free (p);
 
   p = calloc (20, 1);