zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: use of "less" in function and interrupt
Date: Sat, 23 Jul 2016 10:02:35 -0700	[thread overview]
Message-ID: <160723100235.ZM18912@torch.brasslantern.com> (raw)
In-Reply-To: <160720204047.ZM27592@torch.brasslantern.com>

On Jul 20,  8:40pm, Bart Schaefer wrote:
}
} Probably there's some point where the one last wait is needed, within
} the cleanup of jobs in the current shell, to make sure that all the
} subjobs really did go away.  I suspect this to be related to the
} breakup of errflag into ERRFLAG_ERROR and ERRFLAG_INT.

Indeed the following seems to fix it.  All tests still pass and the
several interactive cases I tried appear to do the right thing, but
I'm not sure there isn't some edge case I've missed.  For example,
perhaps we should be saving and restoring errflag around the call
to signal_suspend() so that it can't be cleared by trap handlers?

I call attention to the comments from Oberon and PWS just a few lines
below the context of this diff.

diff --git a/Src/jobs.c b/Src/jobs.c
index 3db2ed0..ce8535d 100644
--- a/Src/jobs.c
+++ b/Src/jobs.c
@@ -1472,7 +1472,7 @@ zwaitjob(int job, int wait_cmd)
 	     */
 	    pipecleanfilelist(jn->filelist, 0);
 	}
-	while (!errflag && jn->stat &&
+	while (!(errflag & ERRFLAG_ERROR) && jn->stat &&
 	       !(jn->stat & STAT_DONE) &&
 	       !(interact && (jn->stat & STAT_STOPPED))) {
 	    signal_suspend(SIGCHLD, wait_cmd);


  parent reply	other threads:[~2016-07-23 17:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-20 11:36 Vincent Lefevre
2016-07-20 12:21 ` Peter Stephenson
2016-07-21  3:40   ` Bart Schaefer
2016-07-21 18:51     ` Vincent Lefevre
2016-07-23 17:02     ` Bart Schaefer [this message]
2016-07-25 13:40       ` Vincent Lefevre

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=160723100235.ZM18912@torch.brasslantern.com \
    --to=schaefer@brasslantern.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).