Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Commit 2155185

Browse files
authored
Merge pull request #267 from dlespiau/20170224-destroypod-fix-daemon
destroy: Don't kill neither the init process nor hyperstart
2 parents 5f819c5 + eb5ffb1 commit 2155185

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/init.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,17 +132,23 @@ static void hyper_term_all(struct hyper_pod *pod)
132132
struct dirent *de;
133133
pid_t *pids = NULL;
134134
struct hyper_exec *e;
135+
pid_t hyperstart_pid;
135136

136137
dp = opendir("/proc");
137138
if (dp == NULL)
138139
return;
139140

141+
142+
hyperstart_pid = getpid();
143+
140144
while ((de = readdir(dp)) && de != NULL) {
141145
if (!isdigit(de->d_name[0]))
142146
continue;
143147
pid = atoi(de->d_name);
144148
if (pid == 1)
145149
continue;
150+
if (pid == hyperstart_pid)
151+
continue;
146152
if (index <= npids) {
147153
pids = realloc(pids, npids + 16384);
148154
if (pids == NULL)

0 commit comments

Comments
 (0)