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

Michal Sekletar msekleta at redhat.com
Fri Oct 3 01:47:56 PDT 2014


On Thu, Oct 02, 2014 at 02:39:10PM +0200, Lennart Poettering wrote:
> 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, for clean-ups. Much appreciated.

Michal

> 
> Thanks,
> 
> Lennart
> 
> -- 
> Lennart Poettering, Red Hat


More information about the systemd-devel mailing list