From patchwork Mon Nov 11 14:40:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arjun Shankar X-Patchwork-Id: 1192958 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-106887-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=lostca.se Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="IXrjqH8H"; dkim=pass (1024-bit key; unprotected) header.d=lostca.se header.i=@lostca.se header.b="jYgs4PC4"; 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 47BYTW2xdQz9sPn for ; Tue, 12 Nov 2019 01:41:03 +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:date:from:to:subject:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=k78 dpam1/uCaYB3Ru5mRf4Mj5e1vXZv6+9hRA8Wqwk5WOTx+hSp61leWgr3VP5Nesoi U2zLhYVO+sULVkG8a0bPPREFsxTzomfA0VjKmfctLuHozH1UBQof0Ov65+pjuaZn trAC/Qe/NfE/f6D9uc+hGWHGj3Oist0xEdCi1VL8= 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:date:from:to:subject:message-id:mime-version :content-type:content-transfer-encoding; s=default; bh=OgE7b0KFr p45nJFqJo5nk2YZOuw=; b=IXrjqH8HKlTbIlgXgPNy97wWtXDrFpQQ1MkzYB3jx bAcR2fAn1MtabqHzgFXbGVavbkyGE6AYFe/XEHPh8Vz+N3GAJJkEoFejUm41l5HQ tW7rNohovf6is/ZDFSf4rJPtqNZaXWN1BxgaDV6d5+i0Hyj2CiJ8qA6E+zXsIK3C rw= Received: (qmail 96504 invoked by alias); 11 Nov 2019 14:40:57 -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 96490 invoked by uid 89); 11 Nov 2019 14:40:57 -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, SPF_PASS autolearn=ham version=3.3.1 spammy=ISO-8859-1, ISO88591 X-HELO: aloka.lostca.se DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=lostca.se; h=date:from:to :subject:message-id:mime-version:content-type :content-transfer-encoding; s=howrah; bh=OgE7b0KFrp45nJFqJo5nk2Y ZOuw=; b=jYgs4PC4uJiRvIAEQB1NQmWGuEeNlPs6VMabnV2iu+O2r4GuNa4dvT/ Olt//JNCOFsOHku9SXjR6LGIw02PfHZ5CZrrsfhIle+P6jxyPmiPSLpt4GMFbaZ0 o2h4q18M7/ObixkPMOg/r2BHGRFiwUFpATXX6VVmSEWwmvD+qmTY= Date: Mon, 11 Nov 2019 14:40:53 +0000 From: Arjun Shankar To: libc-alpha@sourceware.org Subject: [PATCH] libio/tst-fopenloc: Use xsetlocale, xfopen, and xfclose Message-ID: <20191111144052.GB5229@aloka.lostca.se> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) From: Arjun Shankar --- libio/tst-fopenloc.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/libio/tst-fopenloc.c b/libio/tst-fopenloc.c index e9548c57ac..797540da04 100644 --- a/libio/tst-fopenloc.c +++ b/libio/tst-fopenloc.c @@ -25,14 +25,11 @@ #include #include #include +#include +#include static const char inputfile[] = "../iconvdata/testdata/ISO-8859-1"; -static int do_test(void); - -#define TEST_FUNCTION do_test () -#include "../test-skeleton.c" - static int do_bz17916 (void) { @@ -66,14 +63,9 @@ do_test (void) mtrace (); - setlocale (LC_ALL, "de_DE.UTF-8"); + xsetlocale (LC_ALL, "de_DE.UTF-8"); - fp = fopen (inputfile, "r,ccs=ISO-8859-1"); - if (fp == NULL) - { - printf ("cannot open \"%s\": %s\n", inputfile, strerror (errno)); - exit (1); - } + fp = xfopen (inputfile, "r,ccs=ISO-8859-1"); while (! feof_unlocked (fp)) { @@ -85,7 +77,9 @@ do_test (void) fputws (buf, stdout); } - fclose (fp); + xfclose (fp); return do_bz17916 (); } + +#include