summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAurelien Jarno <aurelien@aurel32.net>2017-12-29 14:44:57 +0100
committerAurelien Jarno <aurelien@aurel32.net>2017-12-31 21:21:27 +0100
commit7a64940a59cfbcfd9ac3895df3a5c00ced4ca268 (patch)
treef346de7cd184e2d788adafd3d7061af8c9909694
parent4ebd0c4191c6073cc8a7c5fdcf1d182c4719bcbb (diff)
downloadglibc-7a64940a59cfbcfd9ac3895df3a5c00ced4ca268.tar.gz
tst-realloc: do not check for errno on success [BZ #22611]
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)
-rw-r--r--ChangeLog6
-rw-r--r--malloc/tst-realloc.c4
2 files changed, 6 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 414e931aa5..2e6383b3dc 100644
--- 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>
diff --git a/malloc/tst-realloc.c b/malloc/tst-realloc.c
index 31a58bd026..d942c6e536 100644
--- a/malloc/tst-realloc.c
+++ b/malloc/tst-realloc.c
@@ -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);