Remember to delete un-expandable variables, and do a better job of expanding
[oweals/busybox.git] / init.c
diff --git a/init.c b/init.c
index 55a81d3093cb257b63e62827c98023aee99f6443..52ee6777a55e6c348e50580f7977f2f7d22f791b 100644 (file)
--- a/init.c
+++ b/init.c
@@ -134,7 +134,8 @@ static _syscall2(int, bdflush, int, func, int, data);
 #define INIT_SCRIPT  "/etc/init.d/rcS"   /* Default sysinit script. */
 #endif
 
-static const int MAXENV = 16;  /* Number of env. vars */
+#define MAXENV 16              /* Number of env. vars */
+//static const int MAXENV = 16;        /* Number of env. vars */
 static const int LOG = 0x1;
 static const int CONSOLE = 0x2;
 
@@ -459,9 +460,8 @@ static pid_t run(char *command, char *terminal, int get_enter)
                         * specifies.
                         */
 #ifdef DEBUG_INIT
-                       pid_t shell_pgid = getpid();
                        message(LOG, "Waiting for enter to start '%s' (pid %d, console %s)\r\n",
-                                       command, shell_pgid, terminal);
+                                       command, getpid(), terminal);
 #endif
                        write(fileno(stdout), press_enter, sizeof(press_enter) - 1);
                        getc(stdin);
@@ -470,7 +470,7 @@ static pid_t run(char *command, char *terminal, int get_enter)
 #ifdef DEBUG_INIT
                /* Log the process name and args */
                message(LOG, "Starting pid %d, console %s: '%s'\r\n",
-                               shell_pgid, terminal, command);
+                               getpid(), terminal, command);
 #endif
 
                /* See if any special /bin/sh requiring characters are present */
@@ -886,7 +886,7 @@ extern int init_main(int argc, char **argv)
        setsid();
 
        /* Make sure PATH is set to something sane */
-       putenv(_PATH_STDPATH);
+       putenv("PATH="_PATH_STDPATH);
 
        /* Hello world */
 #ifndef DEBUG_INIT