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