]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/core/locale-setup.c
util-lib: split our string related calls from util.[ch] into its own file string...
[thirdparty/systemd.git] / src / core / locale-setup.c
index 4264ec87511c8d12bf9a496a4fa4dc9d701f8ec8..bd632131b90cde0d699f53a97baf78473de82a32 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <string.h>
-#include <stdlib.h>
 #include <errno.h>
+#include <stdlib.h>
 
-#include "locale-setup.h"
-#include "util.h"
-#include "macro.h"
-#include "virt.h"
-#include "fileio.h"
-#include "strv.h"
 #include "env-util.h"
+#include "fileio.h"
 #include "locale-util.h"
+#include "string-util.h"
+#include "strv.h"
+#include "util.h"
+#include "virt.h"
+#include "locale-setup.h"
 
 int locale_setup(char ***environment) {
         char **add;
         char *variables[_VARIABLE_LC_MAX] = {};
         int r = 0, i;
 
-        if (detect_container(NULL) <= 0) {
+        if (detect_container() <= 0) {
                 r = parse_env_file("/proc/cmdline", WHITESPACE,
                                    "locale.LANG",              &variables[VARIABLE_LANG],
                                    "locale.LANGUAGE",          &variables[VARIABLE_LANGUAGE],
@@ -56,7 +55,7 @@ int locale_setup(char ***environment) {
                                    NULL);
 
                 if (r < 0 && r != -ENOENT)
-                        log_warning_errno(-r, "Failed to read /proc/cmdline: %m");
+                        log_warning_errno(r, "Failed to read /proc/cmdline: %m");
         }
 
         /* Hmm, nothing set on the kernel cmd line? Then let's
@@ -80,7 +79,7 @@ int locale_setup(char ***environment) {
                                    NULL);
 
                 if (r < 0 && r != -ENOENT)
-                        log_warning_errno(-r, "Failed to read /etc/locale.conf: %m");
+                        log_warning_errno(r, "Failed to read /etc/locale.conf: %m");
         }
 
         add = NULL;