]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/core/locale-setup.c
Add SPDX license identifiers to source files under the LGPL
[thirdparty/systemd.git] / src / core / locale-setup.c
index 4264ec87511c8d12bf9a496a4fa4dc9d701f8ec8..6240a83197ae13866e8313e66b6c0fb87a55f68d 100644 (file)
@@ -1,5 +1,4 @@
-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /***
   This file is part of systemd.
 
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <string.h>
-#include <stdlib.h>
 #include <errno.h>
+#include <stdlib.h>
 
+#include "env-util.h"
+#include "fileio.h"
 #include "locale-setup.h"
+#include "locale-util.h"
+#include "string-util.h"
+#include "strv.h"
 #include "util.h"
-#include "macro.h"
 #include "virt.h"
-#include "fileio.h"
-#include "strv.h"
-#include "env-util.h"
-#include "locale-util.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 +54,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 +78,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;
@@ -90,7 +88,7 @@ int locale_setup(char ***environment) {
                 if (!variables[i])
                         continue;
 
-                s = strjoin(locale_variable_to_string(i), "=", variables[i], NULL);
+                s = strjoin(locale_variable_to_string(i), "=", variables[i]);
                 if (!s) {
                         r = -ENOMEM;
                         goto finish;