zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: bug in zsh wait builtin - rhbz#1150541
Date: Sat, 25 Oct 2014 14:54:43 -0700	[thread overview]
Message-ID: <141025145443.ZM23266@torch.brasslantern.com> (raw)
In-Reply-To: <20141025200847.782316a4@pws-pc.ntlworld.com>

On Oct 25,  8:08pm, Peter Stephenson wrote:
}
} Here's an implementation.  I've given it the obvious finger test, but
} there may be some more stressful tests we could apply.  Note I'm only
} recording background PIDs, since the user can't explicitly wait for
} foreground PIDs; it's possible I've missed a case where something can
} be in the background but that would suggest the job is wrongly recorded.

I was going to ask a bunch of questions about this but in looking at the
patch I realized that you determine foreground-ness at the time the job
exits, not at the time it's started, so this sounds fine.

Incidentally, when you ^Z the foreground job, the value of $! is not
updated, so the only way to use wait is by job identifier (which is
equivalent to using fg).  $! finally does get updated when the job is
continued with bg.  (This describes the pre-33531-patch state, but I
don't think the patch alters it.)

} One piece of unfinished business: I think lastpid_status can go, but
} the logic associated with it is rather different from what I just
} implemented so I'd like some further thoughts

I can't think of a case where lastpid_status would not be the same as
getbgstatus(lastpid) ... I suppose you could throw in a DPUTS() to
confirm that, just as a sanity check, but otherwise I concur that you
can do away with lastpid_status.


  reply	other threads:[~2014-10-25 21:55 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-21  7:53 Tim Speetjens
2014-10-21 20:02 ` Peter Stephenson
2014-10-22  6:55   ` Bart Schaefer
     [not found]     ` <CAO7vJOjrb=N3xuTJVSb7U8mdXtexYp8nN4YaoknfUb3fofU2zg@mail.gmail.com>
2014-10-22 15:48       ` Bart Schaefer
2014-10-22 18:32     ` Chet Ramey
2014-10-23  8:32     ` Peter Stephenson
2014-10-24  4:50       ` Bart Schaefer
2014-10-24  8:04         ` Tim Speetjens
2014-10-25 19:08         ` Peter Stephenson
2014-10-25 21:54           ` Bart Schaefer [this message]
2014-10-25 22:28           ` Bart Schaefer
2014-10-25 22:32             ` Bart Schaefer
2014-10-25 23:04               ` Peter Stephenson
2014-10-25 23:17                 ` Peter Stephenson
2014-10-26 19:01                   ` Peter Stephenson
2014-10-26 20:41                     ` Bart Schaefer
2014-10-26 21:22                       ` Peter Stephenson

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=141025145443.ZM23266@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).