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

Re: Bug related to stdin/always/jobcontrol



On Sep 14, 10:35pm, Peter Stephenson wrote:
} Subject: Re: Bug related to stdin/always/jobcontrol
}
} I present the solution for verification.  If accepted, I will be
} demanding a certifcate of some sort.

Thank you for digging through this.  I was expecting to need to dive
into it, and my schedule the next several days would not have been
amenable.

Your explanation makes sense and the code looks sane, I think you can
claim your certificate.

} SIGCONT when we're dealing with a superjob in killjb():
} 
}                 for (pn = jn->procs; pn->next; pn = pn->next)
}                     if (kill(pn->pid, sig) == -1 && errno != ESRCH)
} 			err = -1;
} 
} The exit test is pn->next, so we skip the last process in the superjob,
} which is a bit weird.

I think this has to do with fork-to-the-left on pipelines, i.e., in
the "more normal case" the last process in the superjob is either
the current shell or the process group leader.  The loop leaves pn
pointing to the last process, and then the following bit --

                if (!jobtab[jn->other].procs && pn)
                    if (kill(pn->pid, sig) == -1 && errno != ESRCH)
                        err = -1;

-- sends that process the signal, except not when there are "other"
procs, so I don't quite grok that part.



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