diff options
author | Jon TURNEY <jon.turney@dronecode.org.uk> | 2015-02-22 16:11:39 +0000 |
---|---|---|
committer | Jon TURNEY <jon.turney@dronecode.org.uk> | 2015-02-22 17:50:12 +0000 |
commit | 128b54740c1bfcf35acb16d1cc44e1885a864478 (patch) | |
tree | 27c3b708a64c62c121c0d5cf8e4d8c427ad977de | |
parent | 6265f110ee34f97fccd256acaf0f4e6307f0df68 (diff) |
Log locale when it's not supported by X
-rw-r--r-- | hw/xwin/InitOutput.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c index e4b350ae1..47a32eae5 100644 --- a/hw/xwin/InitOutput.c +++ b/hw/xwin/InitOutput.c @@ -1071,6 +1071,8 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[]) /* Perform some one time initialization */ if (1 == serverGeneration) { + const char *locale; + /* Allow multiple threads to access Xlib */ if (XInitThreads() == 0) { ErrorF("XInitThreads failed.\n"); @@ -1080,13 +1082,14 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[]) * setlocale applies to all threads in the current process. * Apply locale specified in LANG environment variable. */ - if (!setlocale(LC_ALL, "")) { + locale = setlocale(LC_ALL, ""); + if (!locale) { ErrorF("setlocale failed.\n"); } /* See if X supports the current locale */ if (XSupportsLocale() == FALSE) { - ErrorF("Warning: Locale not supported by X, falling back to 'C' locale.\n"); + ErrorF("Warning: Locale '%s' not supported by X, falling back to 'C' locale.\n", locale); setlocale(LC_ALL, "C"); } } |