zsh-workers
 help / color / Atom feed
* Confused by SIGCONT sent to running processes
@ 2020-06-24  7:49 Roman Perepelitsa
  0 siblings, 0 replies; only message in thread
From: Roman Perepelitsa @ 2020-06-24  7:49 UTC (permalink / raw)
  To: Zsh hackers list

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.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-24  7:49 Confused by SIGCONT sent to running processes Roman Perepelitsa

zsh-workers

Archives are clonable: git clone --mirror http://inbox.vuxu.org/zsh-workers

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.zsh.workers


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git