1 --- sysvinit-2.88dsf/src/init.c.wiget 2011-12-03 23:39:16.988206898 +0100
2 +++ sysvinit-2.88dsf/src/init.c 2011-12-03 23:47:53.761427001 +0100
3 @@ -880,7 +880,7 @@ char **init_buildenv(int child)
7 - e = calloc(n, sizeof(char *));
8 + e = imalloc(n * sizeof(char *));
10 for (n = 0; environ[n]; n++)
11 e[n] = istrdup(environ[n]);
12 @@ -911,6 +911,9 @@ void init_freeenv(char **e)
19 for (n = 0; e[n]; n++)
22 @@ -1976,7 +1979,7 @@ void re_exec(void)
24 sigset_t mask, oldset;
30 if (strchr("S0123456",runlevel) == NULL)
31 @@ -2027,8 +2030,13 @@ void re_exec(void)
33 * The existing init process execs a new init binary.
35 - env = init_buildenv(0);
36 - execle(myname, myname, "--init", NULL, env);
39 + * The existing init process execs a new init binary.
41 + env = init_buildenv(0);
42 + execle(myname, myname, "--init", NULL, env);
46 * We shouldn't be here, something failed.
47 @@ -2729,7 +2737,7 @@ int telinit(char *progname, int argc, ch
48 if (!strchr("0123456789SsQqAaBbCcUu", argv[optind][0]))
50 request.cmd = INIT_CMD_RUNLVL;
51 - request.runlevel = env ? 0 : argv[optind][0];
52 + request.runlevel = argv[optind][0];
53 request.sleeptime = sltime;