Make the locale stuff only do the getpid==1 check if BB_INIT is defined
authorEric Andersen <andersen@codepoet.org>
Sun, 13 May 2001 00:33:16 +0000 (00:33 -0000)
committerEric Andersen <andersen@codepoet.org>
Sun, 13 May 2001 00:33:16 +0000 (00:33 -0000)
applets/busybox.c
busybox.c

index 41b6069edb79bc0b4d4251296fc90044dd5eb5dc..9cc884854c1bf97bca8543cb7ad3e53fad1bcb9e 100644 (file)
@@ -82,9 +82,13 @@ int main(int argc, char **argv)
        }
 #endif
 
-#ifdef BB_LOCALE_SUPPORT
+#ifdef BB_LOCALE_SUPPORT 
+#ifdef BB_INIT
        if(getpid()!=1) /* Do not set locale for `init' */
+#endif
+       {
                setlocale(LC_ALL, "");
+       }
 #endif
 
        run_applet_by_name(applet_name, argc, argv);
index 41b6069edb79bc0b4d4251296fc90044dd5eb5dc..9cc884854c1bf97bca8543cb7ad3e53fad1bcb9e 100644 (file)
--- a/busybox.c
+++ b/busybox.c
@@ -82,9 +82,13 @@ int main(int argc, char **argv)
        }
 #endif
 
-#ifdef BB_LOCALE_SUPPORT
+#ifdef BB_LOCALE_SUPPORT 
+#ifdef BB_INIT
        if(getpid()!=1) /* Do not set locale for `init' */
+#endif
+       {
                setlocale(LC_ALL, "");
+       }
 #endif
 
        run_applet_by_name(applet_name, argc, argv);