This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: RFA: ensure binary objects opened in binary mode
> Date: Sat, 18 Feb 2006 12:45:20 +0200
> From: Eli Zaretskii <eliz@gnu.org>
>
> > Date: Fri, 17 Feb 2006 18:41:41 -0500
> > From: Christopher Faylor <cgf-please-use-the-mailinglist@sourceware.org>
> >
> > On Fri, Feb 17, 2006 at 04:59:27PM -0500, Charles Wilson wrote:
> > >2006-02-17 Charles Wilson <...>
> > >
> > > * gdb/solib.c(solib_open): ensure solib files are opened in
> > > binary mode.
> >
> > I think this patch is a good idea but I'm wondering if we're doing the
> >
> > #ifdef O_BINARY
> > # define O_BINARY 0
> > #endif
> >
> > trick in too many source files. Maybe it's time for this to be in a header
> > file?
>
> Agreed. I think defs.h is a good place, do you agree?
>
Problem is that right now defs.h doesn't include <fcntl.h> (where I
expect O_BINARY to be defined on systems that have it). So we should
move that into fcntl.h as well (which is fine with me; we already
assume all systems have it, and we alredy include <unistd.h> from
defs.h).
Charles, one style nit: you need a space before and after the '|',
i.e. O_RDONLY | O_BINARY.
Mark