Carlos O'Donell 0e17ea2
Short description: Fix newlocale error return.
Carlos O'Donell 0e17ea2
Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
Carlos O'Donell 0e17ea2
Origin: PATCH
Carlos O'Donell 0e17ea2
Bug-RHEL: #832516
Carlos O'Donell 0e17ea2
Bug-Fedora: #827510
Carlos O'Donell 0e17ea2
Bug-Upstream: #14247
Carlos O'Donell 0e17ea2
Upstream status: not-submitted
Carlos O'Donell 0e17ea2
Carlos O'Donell 0e17ea2
This needs to go upstream right away to fix the error case for
Carlos O'Donell 0e17ea2
newlocale not correctly returning an error.
8b98471
Carlos O'Donell 0e17ea2
2012-06-14  Jeff Law  <law@redhat.com>
8b98471
8b98471
	* locale/loadlocale.c (_nl_load_locale): Delay setting
8b98471
	file->decided until we have successfully loaded the file's
8b98471
	data.
8b98471
8b98471
diff --git a/locale/loadlocale.c b/locale/loadlocale.c
8b98471
index e3fa187..9fd9216 100644
8b98471
--- a/locale/loadlocale.c
8b98471
+++ b/locale/loadlocale.c
8b98471
@@ -169,7 +169,6 @@ _nl_load_locale (struct loaded_l10nfile *file, int category)
8b98471
   int save_err;
8b98471
   int alloc = ld_mapped;
8b98471
 
8b98471
-  file->decided = 1;
8b98471
   file->data = NULL;
8b98471
 
051a34b
   fd = __open_nocancel (file->filename, O_RDONLY | O_CLOEXEC);
8b98471
@@ -278,6 +277,7 @@ _nl_load_locale (struct loaded_l10nfile *file, int category)
8b98471
   newdata->alloc = alloc;
8b98471
 
8b98471
   file->data = newdata;
8b98471
+  file->decided = 1;
8b98471
 }
8b98471
 
8b98471
 void