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

Re: prob: fg not sending CONT to 'make' children



Bart Schaefer wrote:

> Note the negated PID, which turns the kill() into a killpg().  So gmake is
> a process group leader, though whether it did that itself or zsh did it,
> I'm not entirely sure; but I tend to "blame" zsh because 3.0.5 and 3.1.5
> do not have the same problem.
> 
> I think this must be a case where process group management was updated
> elsewhere but the change was not reflected in killjb().  The following
> patch resumes the make properly in this particular example, but I'm not
> sure it isn't an over-use of killpg() -- Sven, can you comment?

I hope: this is connected to 6824 which allowed such processes
(started from a function, no pipe) to use their own process group --
more precisely, it tried to handle such processes in their own group
correctly. I just didn't remember to change killjb() for that. Never
tried it with a command that actually needed that, it seems.

I think we could add some extra safety by first trying killpg() and
then using kill() if that fails.

Bye
 Sven

--- os/signals.c	Mon Aug 30 10:01:46 1999
+++ Src/signals.c	Mon Aug 30 10:21:42 1999
@@ -591,7 +591,8 @@
         if (jn->stat & STAT_SUPERJOB) {
             if (sig == SIGCONT) {
                 for (pn = jobtab[jn->other].procs; pn; pn = pn->next)
-                    killpg(pn->pid, sig);
+                    if (killpg(pn->pid, sig) == -1)
+			kill(pn->pid, sig);
  
                 for (pn = jn->procs; pn->next; pn = pn->next)
                     err = kill(pn->pid, sig);

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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