diff options
author | Ulrich Drepper <drepper@redhat.com> | 2003-05-21 19:31:11 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2003-05-21 19:31:11 +0000 |
commit | 2e1198646d3beea12bf94f9eca147b4378c65e70 (patch) | |
tree | 8059ce6131cc6346b36e8f750ca8f45a940c25c4 /locale | |
parent | 398256ea61b263d7ee22ac6b0045c5caa2fb30f6 (diff) | |
download | glibc-2e1198646d3beea12bf94f9eca147b4378c65e70.tar.gz glibc-2e1198646d3beea12bf94f9eca147b4378c65e70.tar.xz glibc-2e1198646d3beea12bf94f9eca147b4378c65e70.zip |
Update.
2003-05-21 Petter Reinholdtsen <pere@hungry.com> * locale/programs/locale.c (main): Report an error if setlocale() fails [PR libc/2254]. 2003-05-21 Jakub Jelinek <jakub@redhat.com> * sysdeps/unix/sysv/linux/s390/system.c: New file. 2003-05-21 Jakub Jelinek <jakub@redhat.com> * 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.
Diffstat (limited to 'locale')
-rw-r--r-- | locale/programs/locale.c | 13 |
1 files changed, 9 insertions, 4 deletions
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_*. */ |