zsh-workers
 help / color / mirror / code / Atom feed
From: Roman Perepelitsa <roman.perepelitsa@gmail.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Confused by SIGCONT sent to running processes
Date: Wed, 24 Jun 2020 09:49:05 +0200	[thread overview]
Message-ID: <CAN=4vMrTvfPS0GcQfPN4POgNtd=UgeVbUKJdsty2fbEa95f5ng@mail.gmail.com> (raw)

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.

                 reply	other threads:[~2020-06-24  7:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAN=4vMrTvfPS0GcQfPN4POgNtd=UgeVbUKJdsty2fbEa95f5ng@mail.gmail.com' \
    --to=roman.perepelitsa@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).