fix Red Hat BZ#1479320 by making interactive shells remember async PIDs too

This commit is contained in:
tg 2017-08-08 14:30:10 +00:00
parent 1fa38c9c2c
commit 6327ca02f2
1 changed files with 9 additions and 3 deletions

12
jobs.c
View File

@ -23,7 +23,7 @@
#include "sh.h" #include "sh.h"
__RCSID("$MirOS: src/bin/mksh/jobs.c,v 1.123 2017/08/08 14:29:23 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/jobs.c,v 1.124 2017/08/08 14:30:10 tg Exp $");
#if HAVE_KILLPG #if HAVE_KILLPG
#define mksh_killpg killpg #define mksh_killpg killpg
@ -1022,8 +1022,14 @@ j_notify(void)
} }
for (j = job_list; j; j = tmp) { for (j = job_list; j; j = tmp) {
tmp = j->next; tmp = j->next;
if (j->flags & JF_REMOVE) if (j->flags & JF_REMOVE) {
remove_job(j, "notify"); if (j == async_job || (j->flags & JF_KNOWN)) {
j->flags = (j->flags & ~JF_REMOVE) | JF_ZOMBIE;
j->job = -1;
nzombie++;
} else
remove_job(j, "notify");
}
} }
shf_flush(shl_out); shf_flush(shl_out);
#ifndef MKSH_NOPROSPECTOFWORK #ifndef MKSH_NOPROSPECTOFWORK