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