From patchwork Thu Dec 21 22:54:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aurelien Jarno X-Patchwork-Id: 25068 Received: (qmail 50394 invoked by alias); 21 Dec 2017 22:55:06 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 50165 invoked by uid 89); 21 Dec 2017 22:55:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=Hx-languages-length:1260 X-HELO: hall.aurel32.net From: Aurelien Jarno To: libc-alpha@sourceware.org Cc: Aurelien Jarno Subject: [PATCH 1/3] tst-realloc: do not check for errno on success [BZ #22611] Date: Thu, 21 Dec 2017 23:54:51 +0100 Message-Id: <20171221225453.13158-2-aurelien@aurel32.net> In-Reply-To: <20171221225453.13158-1-aurelien@aurel32.net> References: <20171221225453.13158-1-aurelien@aurel32.net> 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. Reviewed-by: Carlos O'Donell --- ChangeLog | 6 ++++++ malloc/tst-realloc.c | 4 ---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 55295b1368..cb41a07a25 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2017-12-21 Aurelien Jarno + + [BZ #22611] + * malloc/tst-realloc.c (do_test): Remove the test checking that errno + is unchanged on success. + 2017-12-21 Szabolcs Nagy * scripts/build-many-glibcs.py (Context.add_all_configs): Add 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);