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