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

Re: signal mask bug?

On Feb 16, 12:18pm, Danek Duvall wrote:
} So my colleague did some digging and found that the process is marked with
} WCONTFLG, and that once that happens, you have to check WIFCONTINUED()
} before anything else, because WCONTFLG overwrites all the bits.

Thanks.  Slight variation on the patch:

diff --git a/Src/signals.c b/Src/signals.c
index a717677..68a7ae3 100644
--- a/Src/signals.c
+++ b/Src/signals.c
@@ -522,6 +522,11 @@ wait_for_processes(void)
 #if defined(HAVE_WAIT3) && defined(HAVE_GETRUSAGE)
 		struct timezone dummy_tz;
 		gettimeofday(&pn->endtime, &dummy_tz);
+		if (WIFCONTINUED(status))
+		    pn->status = SP_RUNNING;
+		else
 		pn->status = status;
 		pn->ti = ru;

There might be an argument for checking whether the status is already
SP_RUNNING but the above should cover the case of a stopped job that
is sent a SIGCONT from "elsewhere" (i.e., not via fg or bg from the
controlling shell).

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