From 2e1198646d3beea12bf94f9eca147b4378c65e70 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 21 May 2003 19:31:11 +0000 Subject: Update. 2003-05-21 Petter Reinholdtsen * locale/programs/locale.c (main): Report an error if setlocale() fails [PR libc/2254]. 2003-05-21 Jakub Jelinek * sysdeps/unix/sysv/linux/s390/system.c: New file. 2003-05-21 Jakub Jelinek * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h (LOADARGS_0, LOADARGS_1, LOADARGS_2, LOADARGS_3, LOADARGS_4, LOADARGS_5, LOADARGS_6): Don't error if syscall argument is a string literal. * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h (LOADARGS_0, LOADARGS_1, LOADARGS_2, LOADARGS_3, LOADARGS_4, LOADARGS_5, LOADARGS_6): Likewise. --- locale/programs/locale.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'locale') diff --git a/locale/programs/locale.c b/locale/programs/locale.c index 9dc0e393a9..49ed7a2b5b 100644 --- a/locale/programs/locale.c +++ b/locale/programs/locale.c @@ -191,8 +191,10 @@ main (int argc, char *argv[]) /* Set locale. Do not set LC_ALL because the other categories must not be affected (according to POSIX.2). */ - setlocale (LC_CTYPE, ""); - setlocale (LC_MESSAGES, ""); + if (setlocale (LC_CTYPE, "") == NULL) + error (0, errno, gettext ("Cannot set LC_CTYPE to default locale")); + if (setlocale (LC_MESSAGES, "") == NULL) + error (0, errno, gettext ("Cannot set LC_MESSAGES to default locale")); /* Initialize the message catalog. */ textdomain (PACKAGE); @@ -203,7 +205,9 @@ main (int argc, char *argv[]) /* `-a' requests the names of all available locales. */ if (do_all != 0) { - setlocale (LC_COLLATE, ""); + if (setlocale (LC_COLLATE, "") == NULL) + error (0, errno, + gettext ("Cannot set LC_COLLATE to default locale")); write_locales (); exit (EXIT_SUCCESS); } @@ -218,7 +222,8 @@ main (int argc, char *argv[]) /* Specific information about the current locale are requested. Change to this locale now. */ - setlocale (LC_ALL, ""); + if (setlocale (LC_ALL, "") = NULL) + error (0, errno, gettext ("Cannot set LC_ALL to default locale")); /* If no real argument is given we have to print the contents of the current locale definition variables. These are LANG and the LC_*. */ -- cgit v1.2.3