From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4104 invoked from network); 23 Mar 2009 12:28:20 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 23 Mar 2009 12:28:20 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 12466 invoked from network); 23 Mar 2009 12:28:15 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 23 Mar 2009 12:28:15 -0000 Received: (qmail 16230 invoked by alias); 23 Mar 2009 12:28:09 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 26769 Received: (qmail 16214 invoked from network); 23 Mar 2009 12:28:09 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 23 Mar 2009 12:28:09 -0000 Received: from cluster-d.mailcontrol.com (cluster-d.mailcontrol.com [85.115.60.190]) by bifrost.dotsrc.org (Postfix) with ESMTPS id 697EC80590EB for ; Mon, 23 Mar 2009 13:28:04 +0100 (CET) Received: from cameurexb01.EUROPE.ROOT.PRI ([193.128.72.68]) by rly43d.srv.mailcontrol.com (MailControl) with ESMTP id n2NCRjgp017028 for ; Mon, 23 Mar 2009 12:28:02 GMT Received: from news01 ([10.99.11.74]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.3959); Mon, 23 Mar 2009 12:27:18 +0000 Date: Mon, 23 Mar 2009 12:27:14 +0000 From: Peter Stephenson To: zsh-workers Subject: Re: cd -s symlink hangs (sometimes?) Message-ID: <20090323122714.3373526a@news01> In-Reply-To: <237967ef0903230446u6810c06cs511fddcc21fd2a8a@mail.gmail.com> References: <237967ef0903201412h2a7b99c9ya5101509a3972313@mail.gmail.com> <20090320224856.73dae001@pws-pc> <237967ef0903201615x72769fe4va86273c3fa07cb2e@mail.gmail.com> <20090322125410.66a9d294@pws-pc> <237967ef0903221605h11983bb4v4eda8d2a1c41a1c9@mail.gmail.com> <20090323104928.0c59c30f@news01> <237967ef0903230446u6810c06cs511fddcc21fd2a8a@mail.gmail.com> Organization: CSR X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.8; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 23 Mar 2009 12:27:18.0727 (UTC) FILETIME=[B513C570:01C9ABB2] X-Scanned-By: MailControl A_08_51_00 (www.mailcontrol.com) on 10.68.0.153 X-Virus-Scanned: ClamAV 0.92.1/9151/Mon Mar 23 06:23:57 2009 on bifrost X-Virus-Status: Clean On Mon, 23 Mar 2009 12:46:10 +0100 Mikael Magnusson wrote: > 2009/3/23 Peter Stephenson : > Trying the patch now and it does stop the leak... but you didn't think > this adventure was over yet, did you? No, I definitely want to fix the diagnostics and at the least the internal setting of pwd when a cd fails, but I'm not sure what a neat way is. > zsh -f > % chmod -x . > % cd -s /nonexisting > cd: no such file or directory: /nonexisting > % ls > ls: write error: Bad file descriptor That was finger trouble: parentheses in the wrong place. Index: Src/utils.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/utils.c,v retrieving revision 1.217 diff -u -r1.217 utils.c --- Src/utils.c 23 Mar 2009 10:58:57 -0000 1.217 +++ Src/utils.c 23 Mar 2009 12:21:25 -0000 @@ -5423,7 +5423,7 @@ #ifdef HAVE_FCHDIR if (d->dirfd < 0) { close_dir = 1; - if ((d->dirfd = open(".", O_RDONLY | O_NOCTTY) < 0) && + if ((d->dirfd = open(".", O_RDONLY | O_NOCTTY)) < 0 && zgetdir(d) && *d->dirname != '/') d->dirfd = open("..", O_RDONLY | O_NOCTTY); } -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070