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: 30250 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); }