[systemd-devel] [PATCH 2/2] localectl: print warning when there are options given on kernel cmdline

Lennart Poettering lennart at poettering.net
Thu Oct 2 05:39:10 PDT 2014


On Wed, 24.09.14 17:18, Michal Sekletar (msekleta at redhat.com) wrote:

Heya,

> +        for (j = VARIABLE_LANG; j < _VARIABLE_LC_MAX; j++)

I think it is much nicer to count from an explicit "0" on here,
instead of "VARIABLE_LANG", since this makes the loop work correctly
even if the order of the enum is changed.

> +                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]);

Warnings should be printed with log_warning() and not printf() so that they end up on stderr, not stdout.

I fixed this now in git.

Thanks,

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list