From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24875 invoked by alias); 12 Jun 2011 22:13:56 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 29474 Received: (qmail 23489 invoked from network); 12 Jun 2011 22:13:45 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <110612151322.ZM28434@torch.brasslantern.com> Date: Sun, 12 Jun 2011 15:13:22 -0700 In-reply-to: <201106121702.p5CH2RDF003570@pws-pc.ntlworld.com> Comments: In reply to Peter Stephenson "Re: killing suspended jobs makes zsh hang after 47d1215" (Jun 12, 6:02pm) References: <201106121702.p5CH2RDF003570@pws-pc.ntlworld.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: killing suspended jobs makes zsh hang after 47d1215 MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Jun 12, 6:02pm, Peter Stephenson wrote: } } Hmm... the original bug was if the (original) job had gone completely. } With the change, the test now covers running and stopped (but still } recognised by the system, i.e. not terminated) jobs. What else is } there? WIFSIGNALED()? WIFCONTINUED()? There's this hunk & comment in Src/jobs.c: #ifndef WIFCONTINUED else if (sig == SIGCONT) { Job jn; Process pn; /* With WIFCONTINUED we find this out properly */ if (findproc(pid, &jn, &pn, 0)) { if (WIFSTOPPED(pn->status)) pn->status = SP_RUNNING; } } #endif But WIFCONTINUED() is tested only in update_job() which in turn is called only when findproc() finds something (Src/signals.c): if (findproc(pid, &jn, &pn, 0)) { #if defined(HAVE_WAIT3) && defined(HAVE_GETRUSAGE) struct timezone dummy_tz; gettimeofday(&pn->endtime, &dummy_tz); pn->status = status; pn->ti = ru; #else update_process(pn, status); #endif update_job(jn); } else if (findproc(pid, &jn, &pn, 1)) { pn->status = status; update_job(jn); We were collectively wrong about SP_RUNNING; perhaps its the case that there's a single state this ought to be avoiding, rather than a list of them that it should be accepting.