From: Peter Stephenson <p.stephenson@samsung.com>
To: zsh-workers@zsh.org
Subject: Re: Wait test failure
Date: Mon, 10 Aug 2015 16:48:52 +0100 [thread overview]
Message-ID: <20150810164852.0e5934f4@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <20150810161817.080bcdee@pwslap01u.europe.root.pri>
On Mon, 10 Aug 2015 16:18:17 +0100
Peter Stephenson <p.stephenson@samsung.com> wrote:
>
> I'm wondering if in
>
> (exit 1) &
> one=$!
> (exit 2) &
> two=$!
>
> when we handle the first background process, sometimes the second has
> already exited so we use the status from that instead? That would be
> quite serious --- and quite possibly not a new effect, just exacerbated
> by additional signal blocking.
Hmm...
Never second guess a quantity you can calculate explicitly.
Ismail, does this fix your occurrence of the problem, too?
diff --git a/Src/signals.c b/Src/signals.c
index 697c4c5..78dc75b 100644
--- a/Src/signals.c
+++ b/Src/signals.c
@@ -528,8 +528,14 @@ wait_for_processes(void)
* and is not equal to the current foreground job.
*/
if (jn && !(jn->stat & (STAT_CURSH|STAT_BUILTIN)) &&
- jn - jobtab != thisjob)
- addbgstatus(pid, (int)lastval2);
+ jn - jobtab != thisjob) {
+ int val = (WIFSIGNALED(status) ?
+ 0200 | WTERMSIG(status) :
+ (WIFSTOPPED(status) ?
+ 0200 | WEXITSTATUS(status) :
+ WEXITSTATUS(status)));
+ addbgstatus(pid, val);
+ }
}
}
next prev parent reply other threads:[~2015-08-10 15:49 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-08 19:05 5.0.9 eventually...? Peter Stephenson
2015-08-08 20:40 ` Bart Schaefer
2015-08-08 20:50 ` Mikael Magnusson
2015-08-09 0:20 ` Bart Schaefer
2015-08-08 21:22 ` Oliver Kiddle
2015-08-09 0:23 ` Bart Schaefer
2015-08-09 0:24 ` Bart Schaefer
2015-08-09 14:45 ` Jun T.
2015-08-09 16:15 ` Completion after assignment as command (Re: 5.0.9 eventually...?) Peter Stephenson
2015-08-10 7:12 ` 5.0.9 eventually...? Ismail Donmez
2015-08-10 9:59 ` Ismail Donmez
2015-08-10 12:50 ` Wait test failure Peter Stephenson
2015-08-10 15:18 ` Peter Stephenson
2015-08-10 15:48 ` Peter Stephenson [this message]
2015-08-10 17:44 ` Bart Schaefer
2015-08-10 19:11 ` Peter Stephenson
2015-08-10 17:24 ` A05 test failure (was Re: 5.0.9 eventually...?) Bart Schaefer
2015-08-11 8:20 ` Ismail Donmez
2015-08-17 19:54 ` 5.0.9 eventually...? Peter Stephenson
2015-08-17 20:08 ` Bart Schaefer
2015-08-17 21:17 ` 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=20150810164852.0e5934f4@pwslap01u.europe.root.pri \
--to=p.stephenson@samsung.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).