From patchwork Fri Dec 22 19:30:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aurelien Jarno X-Patchwork-Id: 852539 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-88551-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="kxhUfyoO"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3z3JXM6YsDz9s83 for ; Sat, 23 Dec 2017 06:31:15 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=dELUqCyXMdjb7rBQlBVXf2Xao3+nKli 6a71gnoyalWdZsoTYrhnPidZB6jwx+8HoRf48Y03YLxDquIAlagqMdr4nDrmN4HH eALBrLEJoDOxxvQkGkT11ADa1EdApgG9HNV5vk7BNtLQ5usGiMjAeBNoIWdJ6zft 4OhUJ7Ss63mY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=NcLdsvh/ZO0WPXCya5iNIkPrhx8=; b=kxhUf yoOTgDmZkcGEb7aJWjk/OvGZGhguQIJOLwXeFhHzJIo7A5iX5Bn7I1anlC4/QfTb JheMMgAAsu1cOxNAJtMtgWn68F4oitc/epi2g36tclAyh3G4eswkOWgxnk0hAYLD oDLUWN4UcOHQpAAix7D58P8RMqiyJMcqTJsT3k= Received: (qmail 127789 invoked by alias); 22 Dec 2017 19:31:09 -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 126959 invoked by uid 89); 22 Dec 2017 19:31:08 -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= X-HELO: hall.aurel32.net From: Aurelien Jarno To: libc-alpha@sourceware.org Cc: Aurelien Jarno Subject: [PATCH v2 1/3] tst-realloc: do not check for errno on success [BZ #22611] Date: Fri, 22 Dec 2017 20:30:59 +0100 Message-Id: <20171222193101.3396-2-aurelien@aurel32.net> In-Reply-To: <20171222193101.3396-1-aurelien@aurel32.net> References: <20171222193101.3396-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. --- ChangeLog | 6 ++++++ malloc/tst-realloc.c | 4 ---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index b296ec0ad6..c8157a4e43 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2017-12-22 Aurelien Jarno + + [BZ #22611] + * malloc/tst-realloc.c (do_test): Remove the test checking that errno + is unchanged on success. + 2017-12-22 Eric Blake Avoid gcc warnings on cygwin 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);