diff options
author | Robert Ancell <robert.ancell@canonical.com> | 2011-09-20 10:54:29 +1000 |
---|---|---|
committer | Robert Ancell <robert.ancell@canonical.com> | 2011-09-20 10:54:29 +1000 |
commit | 8005ca24b6ca1419171d3a7d7a2c4a74c2d010f1 (patch) | |
tree | 06c1c9708ef83f454ec95771e3d180cc18374c9e /liblightdm-gobject | |
parent | b34ddd2b987636d41f6a6490f4d9bb66ee2f5a46 (diff) | |
download | lightdm-8005ca24b6ca1419171d3a7d7a2c4a74c2d010f1.tar.gz |
Set LANG variable based on the user language
Diffstat (limited to 'liblightdm-gobject')
-rw-r--r-- | liblightdm-gobject/language.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/liblightdm-gobject/language.c b/liblightdm-gobject/language.c index e929a35c..5c4f7d57 100644 --- a/liblightdm-gobject/language.c +++ b/liblightdm-gobject/language.c @@ -48,9 +48,14 @@ update_languages (void) return; result = g_spawn_command_line_sync ("locale -a", &stdout_text, &stderr_text, &exit_status, &error); - if (!result || exit_status != 0) - g_warning ("Failed to get languages, locale -a returned %d: %s", exit_status, error->message); - else + if (error) + { + g_warning ("Failed to run 'locale -a': %s", error->message); + g_clear_error (&error); + } + else if (exit_status != 0) + g_warning ("Failed to get languages, locale -a returned %d", exit_status); + else if (result) { gchar **tokens; int i; @@ -76,7 +81,6 @@ update_languages (void) g_strfreev (tokens); } - g_clear_error (&error); g_free (stdout_text); g_free (stderr_text); |