This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: cygwin 1.7 fstat weirdness


On Mon, Apr 6, 2009 at 9:38 PM, Matt Wozniski <godlygeek@gmail.com> 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.
>
> Unless I'm missing something, that code sets fd to 0 if path is
> NULL... which doesn't seem to make any sense at all, since 0 is a
> valid file descriptor number...

Right, the code does something if fd == 0, but I'm actually trying to
avoid learning the internals. ÂAlas this has already chewed up a lot
of time and I haven't made any headway trying to reproduce it so I'm
about ready to throw in the towel. The code path looks very simple:
read the command line and call a function to open a file. The thing
is, the file opens just fine, and I can even read from it, but fstat
(or the S_ISX macros) puke. I tried stripping out all non-essentials
in the Makefile (e.g. it defines __EXTENSIONS__, _GNU_SOURCE, etc. and
 does some odd stuff with paths) to no avail. In case anybody wants
to give it a try on another machine, the function is tcreadfile in
tcutil.h in Âhttp://sourceforge.net/projects/tokyocabinet/ - remember
you have to add

#define strtold(a,b) ((long double)strtod((a),(b)))

to tcutil.c so tcatoix will compile. Other than that I think it will
compile on 1.7.

Thanks,

gregg

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]