Blame support/xsetlocale.c

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