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

Re: Small problem with suspend-a-loop patch (6707)



Bart Schaefer wrote:

> The first time a loop is suspended and then brought back into the foreground,
> the job status is reported incorrectly; every time thereafter it's correct.

Oh. there was this explicit test to avoid setting the status of the
last process of a super-job to SP_RUNNING (the last process is the
shell forked for the tail of a pipeline).

I don't remember why we had this test, so I only #if'ed it out for
now. Stopping/continuing loops with and without pipes seems to
reported the status correclty with that, but please look out for wrong 
reports everyone.

Bye
 Sven

--- os/jobs.c	Mon Jun 21 12:49:40 1999
+++ Src/jobs.c	Mon Jun 21 13:13:34 1999
@@ -92,8 +92,12 @@
 
     jn->stat &= ~STAT_STOPPED;
     for (pn = jn->procs; pn; pn = pn->next)
+#if 0
 	if (WIFSTOPPED(pn->status) && 
 	    (!(jn->stat & STAT_SUPERJOB) || pn->next))
+	    pn->status = SP_RUNNING;
+#endif
+        if (WIFSTOPPED(pn->status))
 	    pn->status = SP_RUNNING;
 
     if (jn->stat & STAT_SUPERJOB)

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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