SHA256
1
0
forked from pool/systemd
systemd/handle-root-uses-lang.patch

49 lines
1.7 KiB
Diff

Index: systemd-195/src/core/locale-setup.c
===================================================================
--- systemd-195.orig/src/core/locale-setup.c
+++ systemd-195/src/core/locale-setup.c
@@ -69,6 +69,11 @@ static const char * const variable_names
int locale_setup(void) {
char *variables[_VARIABLE_MAX];
int r = 0, i;
+#if defined(TARGET_SUSE)
+ char *root_uses_lang;
+
+ zero(root_uses_lang);
+#endif
zero(variables);
@@ -134,11 +139,21 @@ int locale_setup(void) {
#elif defined(TARGET_SUSE)
if (r <= 0 &&
(r = parse_env_file("/etc/sysconfig/language", NEWLINE,
+ "ROOT_USES_LANG", &root_uses_lang,
"RC_LANG", &variables[VARIABLE_LANG],
NULL)) < 0) {
if (r != -ENOENT)
log_warning("Failed to read /etc/sysconfig/language: %s", strerror(-r));
+ } else {
+ if (!root_uses_lang || root_uses_lang && strcasecmp(root_uses_lang,"yes") != 0) {
+ if (root_uses_lang && strcasecmp(root_uses_lang,"ctype") == 0)
+ variables[VARIABLE_LC_CTYPE]=variables[VARIABLE_LANG];
+ else
+ free(variables[VARIABLE_LANG]);
+
+ variables[VARIABLE_LANG]=strdup("POSIX");
+ }
}
#elif defined(TARGET_DEBIAN) || defined(TARGET_UBUNTU) || defined(TARGET_ANGSTROM)
@@ -247,5 +262,9 @@ finish:
for (i = 0; i < _VARIABLE_MAX; i++)
free(variables[i]);
+#if defined(TARGET_SUSE)
+ free(root_uses_lang);
+#endif
+
return r;
}