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