From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23567 invoked by alias); 26 Jan 2015 16:35:40 -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: 34403 Received: (qmail 15882 invoked from network); 26 Jan 2015 16:35:28 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) 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.2 X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=Ko/6AtSI c=1 sm=1 tr=0 a=FT8er97JFeGWzr5TCOCO5w==:117 a=kj9zAlcOel0A:10 a=q2GGsy2AAAAA:8 a=oR5dmqMzAAAA:8 a=-9mUelKeXuEA:10 a=YNv0rlydsVwA:10 a=r6izXKY3rtGk_waK_CAA:9 a=CjuIK1q_8ugA:10 From: Bart Schaefer Message-id: <150126083525.ZM31610@torch.brasslantern.com> Date: Mon, 26 Jan 2015 08:35:25 -0800 In-reply-to: Comments: In reply to Peter Stephenson "Re: A05 Test Hang" (Jan 26, 10:09am) References: <150125155149.ZM18700@torch.brasslantern.com> <150125160103.ZM11236@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: "Zsh Hackers' List" Subject: Re: A05 Test Hang MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Jan 26, 10:09am, Peter Stephenson wrote: } } I'm still scratching my head over how it hung permanently, When polltty() is true, we call gettyinfo() and settyinfo() even if the file descriptor has nothing to do with a tty. The settyinfo() triggers a SIGTTOU which stops the whole process group. } but it must be something to do with using terminal input mode } when we shouldn't be. So I suppose that's not particularly } suspicious beyond the bug,but I can't quite convince myself... Comments in read_poll() seem to indicate that polltty is only needed as some kind of workaround for Cygwin. It could probably be combined with an isatty() test, or possibly even replaced by one. (Indentation was 5 spaces instead of 4 for those two lines, emacs fixed it for me.) diff --git a/Src/utils.c b/Src/utils.c index d38babb..47d9944 100644 --- a/Src/utils.c +++ b/Src/utils.c @@ -2300,8 +2300,8 @@ read_poll(int fd, int *readchar, int polltty, zlong microseconds) struct ttyinfo ti; #endif - if (fd < 0) - polltty = 0; /* no tty to poll */ + if (fd < 0 || (polltty && !isatty(fd))) + polltty = 0; /* no tty to poll */ #if defined(HAS_TIO) && !defined(__CYGWIN__) /*