From 6327ca02f2df98a7367425f42e347dcfb115fdaa Mon Sep 17 00:00:00 2001 From: tg Date: Tue, 8 Aug 2017 14:30:10 +0000 Subject: [PATCH] fix Red Hat BZ#1479320 by making interactive shells remember async PIDs too --- jobs.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/jobs.c b/jobs.c index 9ed4346..4df98b7 100644 --- a/jobs.c +++ b/jobs.c @@ -23,7 +23,7 @@ #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 #define mksh_killpg killpg @@ -1022,8 +1022,14 @@ j_notify(void) } for (j = job_list; j; j = tmp) { tmp = j->next; - if (j->flags & JF_REMOVE) - remove_job(j, "notify"); + if (j->flags & JF_REMOVE) { + 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); #ifndef MKSH_NOPROSPECTOFWORK