Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: cd -s symlink hangs (sometimes?)
- X-seq: zsh-workers 26769
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-workers <zsh-workers@xxxxxxxxxx>
- Subject: Re: cd -s symlink hangs (sometimes?)
- Date: Mon, 23 Mar 2009 12:27:14 +0000
- In-reply-to: <237967ef0903230446u6810c06cs511fddcc21fd2a8a@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- Organization: CSR
- References: <237967ef0903201412h2a7b99c9ya5101509a3972313@xxxxxxxxxxxxxx> <20090320224856.73dae001@pws-pc> <237967ef0903201615x72769fe4va86273c3fa07cb2e@xxxxxxxxxxxxxx> <20090322125410.66a9d294@pws-pc> <237967ef0903221605h11983bb4v4eda8d2a1c41a1c9@xxxxxxxxxxxxxx> <20090323104928.0c59c30f@news01> <237967ef0903230446u6810c06cs511fddcc21fd2a8a@xxxxxxxxxxxxxx>
On Mon, 23 Mar 2009 12:46:10 +0100
Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
> 2009/3/23 Peter Stephenson <pws@xxxxxxx>:
> 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 <pws@xxxxxxx> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
Messages sorted by:
Reverse Date,
Date,
Thread,
Author