Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: jobs -r doesn't show jobs continued by kill -CONT



On Mon, 4 May 2015 06:52:13 +0800
Han Pingtian <hanpt@xxxxxxxxxxxxxxxxxx> wrote:
> jobs -r doesn't show a job which suspended the continued by kill -CONT:

Not sure whether to use makerunning() here.  It's handled per process
rather than per job at this point, so it's not entirely clear at what
point the STAT_STOPPED flag should be removed, either.

pws

diff --git a/Src/jobs.c b/Src/jobs.c
index 295f4c9..948f61b 100644
--- a/Src/jobs.c
+++ b/Src/jobs.c
@@ -421,8 +421,10 @@ update_job(Job jn)
 
     for (pn = jn->procs; pn; pn = pn->next) {
 #ifdef WIFCONTINUED
-	if (WIFCONTINUED(pn->status))
+	if (WIFCONTINUED(pn->status)) {
+	    jn->stat &= ~STAT_STOPPED;
 	    pn->status = SP_RUNNING;
+	}
 #endif
 	if (pn->status == SP_RUNNING)      /* some processes in this job are running       */
 	    return;                        /* so no need to update job table entry         */



Messages sorted by: Reverse Date, Date, Thread, Author