Blame support/xsetlocale.c
|
Packit Service |
a4d324 |
/* setlocale with error checking.
|
|
Packit Service |
a4d324 |
Copyright (C) 2019 Free Software Foundation, Inc.
|
|
Packit Service |
a4d324 |
This file is part of the GNU C Library.
|
|
Packit Service |
a4d324 |
|
|
Packit Service |
a4d324 |
The GNU C Library is free software; you can redistribute it and/or
|
|
Packit Service |
a4d324 |
modify it under the terms of the GNU Lesser General Public
|
|
Packit Service |
a4d324 |
License as published by the Free Software Foundation; either
|
|
Packit Service |
a4d324 |
version 2.1 of the License, or (at your option) any later version.
|
|
Packit Service |
a4d324 |
|
|
Packit Service |
a4d324 |
The GNU C Library is distributed in the hope that it will be useful,
|
|
Packit Service |
a4d324 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
a4d324 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
a4d324 |
Lesser General Public License for more details.
|
|
Packit Service |
a4d324 |
|
|
Packit Service |
a4d324 |
You should have received a copy of the GNU Lesser General Public
|
|
Packit Service |
a4d324 |
License along with the GNU C Library; if not, see
|
|
Packit Service |
a4d324 |
<https://www.gnu.org/licenses/>. */
|
|
Packit Service |
a4d324 |
|
|
Packit Service |
a4d324 |
#include <support/check.h>
|
|
Packit Service |
a4d324 |
|
|
Packit Service |
a4d324 |
#include <locale.h>
|
|
Packit Service |
a4d324 |
|
|
Packit Service |
a4d324 |
char *
|
|
Packit Service |
a4d324 |
xsetlocale (int category, const char *locale)
|
|
Packit Service |
a4d324 |
{
|
|
Packit Service |
a4d324 |
char *p = setlocale (category, locale);
|
|
Packit Service |
a4d324 |
if (p == NULL)
|
|
Packit Service |
a4d324 |
FAIL_EXIT1 ("error: setlocale (%d, \"%s\")\n", category, locale);
|
|
Packit Service |
a4d324 |
return p;
|
|
Packit Service |
a4d324 |
}
|