Do not dispatch signals to workers without a valid pid.

thanks rille.
This commit is contained in:
Joris Vink 2020-10-16 13:06:08 +02:00
parent ce360e15d6
commit 262a2512f1
1 changed files with 4 additions and 0 deletions

View File

@ -271,6 +271,10 @@ kore_worker_dispatch_signal(int sig)
for (idx = 0; idx < worker_count; idx++) {
kw = WORKER(idx);
if (kw->pid == -1 || kw->pid == 0)
continue;
if (kill(kw->pid, sig) == -1) {
kore_debug("kill(%d, %d): %s", kw->pid, sig, errno_s);
}