From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5979 invoked by alias); 15 Sep 2016 03:24:43 -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: 39336 Received: (qmail 15132 invoked from network); 15 Sep 2016 03:24:43 -0000 X-Qmail-Scanner-Diagnostics: from mail-pf0-f177.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.192.177):SA:0(0.0/5.0):. Processed in 0.139676 secs); 15 Sep 2016 03:24:43 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at brasslantern.com does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=WDQjj6AOoY3GNu3S/pBk1j0M4PGIrBw8V90vxrrtxbo=; b=IOEYIzPtrMAITg02NtrYeR31UQsfqUQouhv+xXXUyz/nrAVFmAN1gFcT+aT4WmtzgP +k0pWhPA0DP8t540FWONx+yGFN8UfYIQzFuuWaJ23Sw1Bhcp24asVXAgazi4ewTg/36r gZUKV+zyvzJYoTKB4HC/TzwO4eCld35ouK+LKaX+mMDCg2zDARw/xt4yz84TXWkPJocH GTrcuuqnJJBW2eskdgi0Z5l8U4pWQtf4yjBn6MqDAcNOG+AhTkWPJa1QmX62LESmUA4A P/pcQcZ89s7dKS8C1OFMT/xcX6BeMrmAcmWv87pB7anjT5wOrQNA2n0DzcQ1uN7ovjyZ m6ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version; bh=WDQjj6AOoY3GNu3S/pBk1j0M4PGIrBw8V90vxrrtxbo=; b=mJHL/xwv5Vx+HTDiJyjNvaRswXExBVUceOVA9ujmPmAU4VPUX6/FmhqVUxl6Z389kU VVS+u8IFyW8q3Q3zGfYJ78RAygn5wbytgixO4GJDP6aL7qMHlsaby/PHQpN9GOoCW5p2 T20aMFfgrnYLA40xY540HVIR+YNjvtPKpT5+M9AesAG2m+ik2bTrI3cZ+FgUtBzyM/3D cNHaEibTKHGrmsDy9re5S3t78KzlIAwFc5Qh+mmklKoSyYC4mW/VptgoeiVjvcBqiV7j wkAg58HK0NqwR8pd+fs+P/pCTTfhWBVWGRQoJzmuBdSGnncJ+f/T0BN439Ffbw50p3SV cZ0Q== X-Gm-Message-State: AE9vXwO1dlOXnyzjGJHljb2bok2c3GMb72WGdCplFhDU4MDCZSOlgjJW+sFRcENnJMdeGQ== X-Received: by 10.98.196.206 with SMTP id h75mr2805765pfk.156.1473909877756; Wed, 14 Sep 2016 20:24:37 -0700 (PDT) From: Bart Schaefer Message-Id: <160914202450.ZM32479@torch.brasslantern.com> Date: Wed, 14 Sep 2016 20:24:50 -0700 In-Reply-To: <20160914223553.3173c8ca@ntlworld.com> Comments: In reply to Peter Stephenson "Re: Bug related to stdin/always/jobcontrol" (Sep 14, 10:35pm) References: <87r392jgd0.fsf@juno.home.vuxu.org> <20160905164207.4630643b@pwslap01u.europe.root.pri> <20160914183105.69862fa9@pwslap01u.europe.root.pri> <20160914223553.3173c8ca@ntlworld.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: Bug related to stdin/always/jobcontrol MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Sep 14, 10:35pm, Peter Stephenson wrote: } Subject: Re: Bug related to stdin/always/jobcontrol } } I present the solution for verification. If accepted, I will be } demanding a certifcate of some sort. Thank you for digging through this. I was expecting to need to dive into it, and my schedule the next several days would not have been amenable. Your explanation makes sense and the code looks sane, I think you can claim your certificate. } SIGCONT when we're dealing with a superjob in killjb(): } } for (pn = jn->procs; pn->next; pn = pn->next) } if (kill(pn->pid, sig) == -1 && errno != ESRCH) } err = -1; } } The exit test is pn->next, so we skip the last process in the superjob, } which is a bit weird. I think this has to do with fork-to-the-left on pipelines, i.e., in the "more normal case" the last process in the superjob is either the current shell or the process group leader. The loop leaves pn pointing to the last process, and then the following bit -- if (!jobtab[jn->other].procs && pn) if (kill(pn->pid, sig) == -1 && errno != ESRCH) err = -1; -- sends that process the signal, except not when there are "other" procs, so I don't quite grok that part.