]> git.pld-linux.org Git - packages/SysVinit.git/blame - sysvinit-alt-fixes.patch
- updated to 3.04
[packages/SysVinit.git] / sysvinit-alt-fixes.patch
CommitLineData
8c5b2406
AF
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
8c5b2406 3@@ -911,6 +911,9 @@ void init_freeenv(char **e)
9ba3a401
ER
4 {
5 int n;
6
7+ if (!e)
8+ return;
9+
10 for (n = 0; e[n]; n++)
11 free(e[n]);
12 free(e);
8c5b2406 13@@ -1976,7 +1979,7 @@ void re_exec(void)
9ba3a401
ER
14 CHILD *ch;
15 sigset_t mask, oldset;
16 pid_t pid;
17- char **env;
18+ char **env = 0;
19 int fd;
20
21 if (strchr("S0123456",runlevel) == NULL)
8c5b2406
AF
22@@ -2027,8 +2030,13 @@ void re_exec(void)
23 /*
24 * The existing init process execs a new init binary.
25 */
9ba3a401 26- env = init_buildenv(0);
8c5b2406 27- execle(myname, myname, "--init", NULL, env);
9ba3a401
ER
28+ if (pid > 0) {
29+ /*
30+ * The existing init process execs a new init binary.
31+ */
32+ env = init_buildenv(0);
e7e717de 33+ execle(myname, myname, "--init", NULL, env);
9ba3a401
ER
34+ }
35
36 /*
37 * We shouldn't be here, something failed.
e1cc0c55 38
This page took 0.032606 seconds and 4 git commands to generate.