init: if libc-based Unicode support is on, run setlocale(LC_ALL, "") at startup
authorDenys Vlasenko <vda.linux@googlemail.com>
Mon, 11 Aug 2014 18:33:18 +0000 (20:33 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Mon, 11 Aug 2014 18:33:18 +0000 (20:33 +0200)
It is not clear why we were excluding init from this.
The "getpid() != 1" clause was there from the beginning (2001)
but not explained.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
libbb/appletlib.c

index f7c416ece8d52c719de2bd1e014ade0f54fde513..a0150854a4443c1b562f6782519df6e3e9829579 100644 (file)
@@ -184,8 +184,7 @@ void lbb_prepare(const char *applet
 #endif
        applet_name = applet;
 
-       /* Set locale for everybody except 'init' */
-       if (ENABLE_LOCALE_SUPPORT && getpid() != 1)
+       if (ENABLE_LOCALE_SUPPORT)
                setlocale(LC_ALL, "");
 
 #if ENABLE_FEATURE_INDIVIDUAL