From patchwork Wed Nov 21 18:39:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 1001343 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-97436-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=efficios.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="hXt/dDRB"; dkim=pass (2048-bit key; unprotected) header.d=efficios.com header.i=@efficios.com header.b="GXW583Hg"; 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 430Wb273dSz9s3C for ; Thu, 22 Nov 2018 05:39:58 +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=xddumO19uL8rBqT14FxSYT4J3EmG2pE AwI37sr3gM2cduinUgIq/tf3tM+EI9LvAfpjU8Swas2xUa8c3p3e6Ov5NAhNnOrl /JkjNiyfkUbWK+9TRV/zmt5e8d+HrKlWSjTnqN0dseahTEEFQYpbmmO1l1d1Ag+O 41dfHKUN87lA= 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=cTrYUXrwzjg2ZiM7MGVYLpJu9w8=; b=hXt/d DRBc7E95aKP3fcvcFTPI1x4z6dIGruVLW/9oGHn9iRKJhNvNvMSrmEYW30q3HsUk 9U+PX9MBxwx3d2Ho3y+FvLjeLLgVlu2nYQ8uXSwmtrcxyW9TZibAoJ/xXnAkfSIO H/j3ICgcTDqWEcnr+MFEvq/Q5Z8PPVWmFo7CFs= Received: (qmail 114711 invoked by alias); 21 Nov 2018 18:39:52 -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 114686 invoked by uid 89); 21 Nov 2018 18:39:52 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail.efficios.com DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com BFD50133E91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1542825588; bh=ngl4wbrkB57rB1enVPhbdC1GajG13YiJUmvhkmrNMtM=; h=From:To:Date:Message-Id; b=GXW583HgFM5tJKSxJNTsMO+SZR/pN8yAk7JmZiQln1Fx4H2b4q8AWHSx7NnF+yFNl cX0mMPHqjko4sdzCf40Hwko1TeHX/ExqZh5fAZeFcP0c6pOhgHbyybehu9AYAJHgyg 2RLHuV3BGANWq7idJ+pDpnE6Lsm3PgjHZDV/6Y45AhWWNBF3Rnhe3Jsyw/Gflfx3XG 0vCt7e9i/EPMgTycBa0SG3O69w39wgU5scrUlH7NQytXEXq9lDxBmnpzEfZTNkznSk ltGSvVXZo63e7Vb1XrqSOiIDj4ojrCWjUql97F4l+HYTnWiMHqZggL/s8UgZnXOHJo v59DTtHbxRy0w== From: Mathieu Desnoyers To: Carlos O'Donell Cc: Florian Weimer , Joseph Myers , Szabolcs Nagy , libc-alpha@sourceware.org, Mathieu Desnoyers Subject: [RFC PATCH v4 3/5] support record failure: flush stdout, use _exit () Date: Wed, 21 Nov 2018 13:39:34 -0500 Message-Id: <20181121183936.8176-3-mathieu.desnoyers@efficios.com> In-Reply-To: <20181121183936.8176-1-mathieu.desnoyers@efficios.com> References: <20181121183936.8176-1-mathieu.desnoyers@efficios.com> Using "exit ()" from pthread_atfork handlers hangs the process. It is therefore not a good way to exit when reporting a testing error. Use _exit () instead, which directly exits the process. However, considering that the buffered stdout is used to output test failure messages, we first need to flush stdout before exiting. Signed-off-by: Mathieu Desnoyers CC: Carlos O'Donell CC: Florian Weimer CC: Joseph Myers CC: Szabolcs Nagy CC: libc-alpha@sourceware.org --- support/check.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/support/check.c b/support/check.c index 78f2b3cde1..bed1d20457 100644 --- a/support/check.c +++ b/support/check.c @@ -22,6 +22,7 @@ #include #include #include +#include #include static void @@ -56,5 +57,6 @@ support_exit_failure_impl (int status, const char *file, int line, va_start (ap, format); print_failure (file, line, format, ap); va_end (ap); - exit (status); + fflush (stdout); + _exit (status); }