[systemd-commits] 2 commits - src/locale
Lennart Poettering
lennart at kemper.freedesktop.org
Thu Oct 2 05:39:12 PDT 2014
src/locale/localectl.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
New commits:
commit b344bcbbfda8fbe14dadc5aa4b5dfb3ced6d76e2
Author: Lennart Poettering <lennart at poettering.net>
Date: Thu Oct 2 14:35:34 2014 +0200
localectl: always print warnings with log_warning() instead of printf()
They really should got to stderr, not stdout.
diff --git a/src/locale/localectl.c b/src/locale/localectl.c
index 9325d9a..3690f9f 100644
--- a/src/locale/localectl.c
+++ b/src/locale/localectl.c
@@ -117,13 +117,12 @@ static void print_overriden_variables(void) {
for (j = 0; j < _VARIABLE_LC_MAX; j++)
if (variables[j]) {
if (print_warning) {
- printf("Warning: Settings on Kernel Command Line override system locale settings in /etc/locale.conf\n");
- printf(" Command Line: %s=%s\n", locale_variable_to_string(j), variables[j]);
+ log_warning("Warning: Settings on kernel command line override system locale settings in /etc/locale.conf.\n"
+ " Command Line: %s=%s\n", locale_variable_to_string(j), variables[j]);
print_warning = false;
- continue;
- }
- printf(" %s=%s\n", locale_variable_to_string(j), variables[j]);
+ } else
+ log_warning(" %s=%s\n", locale_variable_to_string(j), variables[j]);
}
finish:
for (j = 0; j < _VARIABLE_LC_MAX; j++)
commit 63229aa1abdb98aa69fda9819ed2f40c8082762b
Author: Lennart Poettering <lennart at poettering.net>
Date: Thu Oct 2 14:34:55 2014 +0200
localectl: count locale variables from 0, instead of VARIABLE_LANG
That way the we make our code safe regarding reordering of the variables
in the enum.
diff --git a/src/locale/localectl.c b/src/locale/localectl.c
index 5917364..9325d9a 100644
--- a/src/locale/localectl.c
+++ b/src/locale/localectl.c
@@ -114,7 +114,7 @@ static void print_overriden_variables(void) {
goto finish;
}
- for (j = VARIABLE_LANG; j < _VARIABLE_LC_MAX; j++)
+ for (j = 0; j < _VARIABLE_LC_MAX; j++)
if (variables[j]) {
if (print_warning) {
printf("Warning: Settings on Kernel Command Line override system locale settings in /etc/locale.conf\n");
@@ -126,7 +126,7 @@ static void print_overriden_variables(void) {
printf(" %s=%s\n", locale_variable_to_string(j), variables[j]);
}
finish:
- for (j = VARIABLE_LANG; j < _VARIABLE_LC_MAX; j++)
+ for (j = 0; j < _VARIABLE_LC_MAX; j++)
free(variables[j]);
}
More information about the systemd-commits
mailing list