[illumos-Developer] Webrev:: 197 svc.startd may not pick up locale correctly

Albert Lee trisk at opensolaris.org
Wed Mar 30 14:35:50 PDT 2011


On Mon, Mar 28, 2011 at 1:27 PM, shampavman <shampavman.cg at gmail.com> wrote:
> Hi All,
>
>
>
> I needed a review on this please::
>
> http://cr.illumos.org/view/98j7c9nh/
>
>
>
> I have a few concerns on this though. I honestly feel that a fix is not
> required
>
> Reasons:: we already have a check to see if st_locale is NULL.
>
> since we have a variable for checking whether locale is known, we would not
> accidently use st_locale if it is NULL
>
> and hence we will not core dump or exit
>

The description of the original issue is unclear, and I'm confused as
to how this addresses the problem. From what I understand:
* setlocale(LC_ALL, "") will check the environment variables for all
categories including LC_MESSAGES and changes the values for all of the
categories in the current locale.
* setlocale(LC_MESSAGES, "") also checks the environment but only
changes the LC_MESSAGES category in the current locale.
* setlocale(LC_MESSAGES, NULL) returns the existing value for
LC_MESSAGES category without checking the environment.

So this change would have no effect except omitting a second,
redundant environment check.

-Albert



More information about the Developer mailing list