Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Confused by SIGCONT sent to running processes
- X-seq: zsh-workers 46108
- From: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Confused by SIGCONT sent to running processes
- Date: Wed, 24 Jun 2020 09:49:05 +0200
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- Sender: zsh-workers@xxxxxxx
Consider the following command:
( foo | bar )
As soon as foo or bar exits, zsh sends SIGCONT to the remaining
running process. If there are N processes in the pipeline, zsh sends
SIGCONT to all running processes after one of the processes exits. I'm
wondering about the purpose of sending SIGCONT to running jobs here.
SIGCONT is sent from these lines in zwaitjob:
if (subsh)
killjb(jn, SIGCONT);
killjb sends the specified signal (SIGCONT in this case) to all
processes in the job that have been stopped or are running. Here's the
check from killjb:
if (pn->status == SP_RUNNING || WIFSTOPPED(pn->status)) {
...
}
I could understand sending SIGCONT to stopped jobs but why send it to
running jobs? Also, why is it conditional on subsh?
Roman.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author