chiark / gitweb /
build-sys: Add compiler and linker flags to reduce binary size
[elogind.git] / src / locale-setup.c
index cf0d3e556f4b9184289977d0973ceff2cb95e059..ffb4ee999e34965e538a8657e086ec29fab79268 100644 (file)
@@ -93,10 +93,9 @@ int locale_setup(void) {
         }
 
         /* Hmm, nothing set on the kernel cmd line? Then let's
-         * try /etc/locale */
-
+         * try /etc/locale.conf */
         if (r <= 0 &&
-            (r = parse_env_file("/etc/locale", NEWLINE,
+            (r = parse_env_file("/etc/locale.conf", NEWLINE,
                                "LANG",              &variables[VARIABLE_LANG],
                                "LC_CTYPE",          &variables[VARIABLE_LC_CTYPE],
                                "LC_NUMERIC",        &variables[VARIABLE_LC_NUMERIC],
@@ -113,7 +112,7 @@ int locale_setup(void) {
                                 NULL)) < 0) {
 
                 if (r != -ENOENT)
-                        log_warning("Failed to read /etc/locale: %s", strerror(-r));
+                        log_warning("Failed to read /etc/locale.conf: %s", strerror(-r));
         }
 
 #ifdef TARGET_FEDORA
@@ -125,6 +124,27 @@ int locale_setup(void) {
                 if (r != -ENOENT)
                         log_warning("Failed to read /etc/sysconfig/i18n: %s", strerror(-r));
         }
+
+#elif defined(TARGET_SUSE)
+        if (r <= 0 &&
+            (r = parse_env_file("/etc/sysconfig/language", NEWLINE,
+                                "RC_LANG", &variables[VARIABLE_LANG],
+                                NULL)) < 0) {
+
+                if (r != -ENOENT)
+                        log_warning("Failed to read /etc/sysconfig/language: %s", strerror(-r));
+        }
+
+#elif defined(TARGET_DEBIAN)
+        if (r <= 0 &&
+            (r = parse_env_file("/etc/default/locale", NEWLINE,
+                                "LANG", &variables[VARIABLE_LANG],
+                                NULL)) < 0) {
+
+                if (r != -ENOENT)
+                        log_warning("Failed to read /etc/default/locale: %s", strerror(-r));
+        }
+
 #elif defined(TARGET_ARCH)
         if (r <= 0 &&
             (r = parse_env_file("/etc/rc.conf", NEWLINE,
@@ -134,6 +154,7 @@ int locale_setup(void) {
                 if (r != -ENOENT)
                         log_warning("Failed to read /etc/rc.conf: %s", strerror(-r));
         }
+
 #elif defined(TARGET_GENTOO)
         /* Gentoo's openrc expects locale variables in /etc/env.d/
          * These files are later compiled by env-update into shell