zsh-workers
 help / color / mirror / code / 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, other threads:[~2020-06-24  7:50 UTC | newest]

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

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).