Blame support/xsetlocale.c

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