[gdm] Try to load locale-archive from system
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdm] Try to load locale-archive from system
- Date: Fri, 21 Jan 2011 13:50:47 +0000 (UTC)
commit f930e9457137a0c9942082070224964fc42e3886
Author: Bastien Nocera <hadess hadess net>
Date: Fri Jan 21 13:49:38 2011 +0000
Try to load locale-archive from system
The "locale-archive" file lives in /usr/lib/locale/locale-archive
on most systems, so try to load from there, in addition to using
the installation prefix location.
gui/simple-greeter/gdm-languages.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/gui/simple-greeter/gdm-languages.c b/gui/simple-greeter/gdm-languages.c
index a7fa2ae..5607221 100644
--- a/gui/simple-greeter/gdm-languages.c
+++ b/gui/simple-greeter/gdm-languages.c
@@ -47,6 +47,7 @@
#define ALIASES_FILE DATADIR "/gdm/locale.alias"
#define ARCHIVE_FILE LIBLOCALEDIR "/locale-archive"
+#define SYSTEM_ARCHIVE_FILE "/usr/lib/locale/locale-archive"
#define ISO_CODES_DATADIR ISO_CODES_PREFIX "/share/xml/iso-codes"
#define ISO_CODES_LOCALESDIR ISO_CODES_PREFIX "/share/locale"
@@ -464,9 +465,13 @@ collect_locales_from_archive (void)
error = NULL;
mapped = g_mapped_file_new (ARCHIVE_FILE, FALSE, &error);
if (mapped == NULL) {
- g_warning ("Mapping failed for %s: %s", ARCHIVE_FILE, error->message);
+ mapped = g_mapped_file_new (SYSTEM_ARCHIVE_FILE, FALSE, NULL);
+ if (mapped == NULL) {
+ g_warning ("Mapping failed for %s: %s", ARCHIVE_FILE, error->message);
+ g_error_free (error);
+ return FALSE;
+ }
g_error_free (error);
- return FALSE;
}
locales_collected = FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]