-/*-*- 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],
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
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;
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;