Updates from both Vladimir and Larry
[oweals/busybox.git] / busybox.c
index badd53d79de9a7c28dc34fbf1c46903d1f96e8b1..9cc884854c1bf97bca8543cb7ad3e53fad1bcb9e 100644 (file)
--- a/busybox.c
+++ b/busybox.c
@@ -37,10 +37,7 @@ typedef int (*__link_f)(const char *, const char *);
  */
 static char *busybox_fullpath()
 {
-       char proc[256];
-
-       sprintf(proc, "/proc/%d/exe", getpid());
-       return xreadlink(proc);
+       return xreadlink("/proc/self/exe");
 }
 
 /* create (sym)links for each applet */
@@ -85,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);