Re: cygwin 1.7 fstat weirdness

2009-04-07 Thread Gregg Reynolds
On Mon, Apr 6, 2009 at 9:38 PM, Matt Wozniski wrote: > > On Mon, Apr 6, 2009 at 4:11 PM, Corinna Vinschen wrote: > > On Apr  6 14:46, Gregg Reynolds wrote: > >>   int fd = path ? open(path, O_RDONLY, TCFILEMODE) : 0;  // path = > >> "Makefile" > > > > Is fd == 0 by any chance?  The above code sil

Re: cygwin 1.7 fstat weirdness

2009-04-06 Thread Dave Korn
Matt Wozniski wrote: > On Mon, Apr 6, 2009 at 4:11 PM, Corinna Vinschen wrote: >> On Apr 6 14:46, Gregg Reynolds wrote: >>> int fd = path ? open(path, O_RDONLY, TCFILEMODE) : 0; // path = >>> "Makefile" >> Is fd == 0 by any chance? The above code silently sets fd to 0 if it >> can't open path

Re: cygwin 1.7 fstat weirdness

2009-04-06 Thread Matt Wozniski
On Mon, Apr 6, 2009 at 4:11 PM, Corinna Vinschen wrote: > On Apr  6 14:46, Gregg Reynolds wrote: >>   int fd = path ? open(path, O_RDONLY, TCFILEMODE) : 0;  // path = "Makefile" > > Is fd == 0 by any chance?  The above code silently sets fd to 0 if it > can't open path. Unless I'm missing somethin

Re: cygwin 1.7 fstat weirdness

2009-04-06 Thread Gregg Reynolds
On Mon, Apr 6, 2009 at 3:11 PM, Corinna Vinschen wrote: > On Apr  6 14:46, Gregg Reynolds wrote: >> Hi, >> >> I'm trying to get tokyo cabinet running.  I have a strange error.  One >> of the test utilities does: >> >>   #define TCFILEMODE     00644             // permission of a creating file >>  

Re: cygwin 1.7 fstat weirdness

2009-04-06 Thread Corinna Vinschen
On Apr 6 14:46, Gregg Reynolds wrote: > Hi, > > I'm trying to get tokyo cabinet running. I have a strange error. One > of the test utilities does: > > #define TCFILEMODE 00644 // permission of a creating file > int fd = path ? open(path, O_RDONLY, TCFILEMODE) : 0; // path

cygwin 1.7 fstat weirdness

2009-04-06 Thread Gregg Reynolds
Hi, I'm trying to get tokyo cabinet running. I have a strange error. One of the test utilities does: #define TCFILEMODE 00644 // permission of a creating file int fd = path ? open(path, O_RDONLY, TCFILEMODE) : 0; // path = "Makefile" and then fstats: if(fstat(fd, &sbuf)