From: Arjun Shankar Date: Mon, 11 Nov 2019 14:21:55 +0000 (+0100) Subject: libio/tst-fopenloc: Use xsetlocale, xfopen, and xfclose X-Git-Tag: glibc-2.31~268 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f0f0d79ac3a2ed7b4e2b99ff993027172068446e;p=thirdparty%2Fglibc.git libio/tst-fopenloc: Use xsetlocale, xfopen, and xfclose --- diff --git a/libio/tst-fopenloc.c b/libio/tst-fopenloc.c index e9548c57ac9..797540da043 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