From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: Exit code 130 kills pipeline
Date: Thu, 18 Jun 2020 11:49:32 +0100 (BST) [thread overview]
Message-ID: <1332911441.203694.1592477372521@mail2.virginmedia.com> (raw)
In-Reply-To: <CAN=4vMrp+foMSuq_ZP92U1wA-=RMa59Q-51muxSECEhC1gR24Q@mail.gmail.com>
Not a direct part of this bug, but while I'm looking I might at least
mention it, though I suspect it's very minor in practice.
Just looking at the code that sets the return value:
/* last job in pipeline determines exit status */
val = (WIFSIGNALED(pn->status) ?
0200 | WTERMSIG(pn->status) :
(WIFSTOPPED(pn->status) ?
0200 | WEXITSTATUS(pn->status) :
WEXITSTATUS(pn->status)));
signalled = WIFSIGNALED(pn->status);
The only case where the bottom bits are the signal is WIFSIGNALED();
that's the fix that's just gone in, so no problem with that one.
However, I notice the Linux manual page says WEXITSTATUS() is only
useful if WIFEXITED() is true for the status. So the remaining
two cases could possibly do with a bit of surgery. I'm guessing
WIFSTOPPED() usually reports a status of 128 + 0, and if the
process is stopped (not exited) I'm not sure if the user gets
to see the status anyway. So this may be a non-issue.
pws
next prev parent reply other threads:[~2020-06-18 10:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-17 15:45 Roman Perepelitsa
2020-06-17 16:58 ` Peter Stephenson
2020-06-18 5:49 ` Roman Perepelitsa
2020-06-18 10:49 ` Peter Stephenson [this message]
2020-06-17 17:42 ` Mikael Magnusson
2020-06-17 17:46 ` Roman Perepelitsa
2020-06-17 20:34 ` Mikael Magnusson
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=1332911441.203694.1592477372521@mail2.virginmedia.com \
--to=p.w.stephenson@ntlworld.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).