Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Wait test failure



Adding this code at the end of addbgstatus() in jobs.c

    fprintf(stderr, "Added bgstatus %d for %d\n", status, pid);
    fflush(stderr);

shows it's adding the wrong status (2) at the start:

Added bgstatus 2 for 24507
Added bgstatus 2 for 24506
Added bgstatus 3 for 24508

i.e. the problem isn't in the wait, it's already got the wrong status
when the process exits.  However, running this from the command line
doesn't show the problem, even with MONITOR turned off.

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.

pws



Messages sorted by: Reverse Date, Date, Thread, Author