From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26260 invoked from network); 30 Aug 1999 08:22:00 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 30 Aug 1999 08:22:00 -0000 Received: (qmail 12947 invoked by alias); 30 Aug 1999 08:21:45 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7530 Received: (qmail 12940 invoked from network); 30 Aug 1999 08:21:45 -0000 Date: Mon, 30 Aug 1999 10:21:44 +0200 (MET DST) Message-Id: <199908300821.KAA20279@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: "Bart Schaefer"'s message of Sun, 29 Aug 1999 18:42:15 +0000 Subject: 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@informatik.hu-berlin.de