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