From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eli Zaretskii" To: cgf@redhat.com Cc: gdb@sources.redhat.com Subject: Re: DOS/Windows-specific code: source.c Date: Tue, 08 May 2001 12:23:00 -0000 Message-id: <8361-Tue08May2001222325+0300-eliz@is.elta.co.il> References: <20010503211502.21716.qmail@web6401.mail.yahoo.com> <3AF1DAA0.3060702@cygnus.com> <200105071609.TAA24129@is.elta.co.il> <200105081149.OAA06252@is.elta.co.il> <20010508141619.B25705@redhat.com> X-SW-Source: 2001-05/msg00149.html > Date: Tue, 8 May 2001 14:16:19 -0400 > From: Christopher Faylor > > On Tue, May 08, 2001 at 12:22:22PM -0400, DJ Delorie wrote: > >Eli Zaretskii writes: > >> * source.c:openp() > >> > >> #ifdef _WIN32 > >> mode |= O_BINARY; > >> #endif > >> > >>I think this is obsolete and should be removed: defining > >>CRLF_SOURCE_FILES in xm-whatever should solve the underlying problem. > > > >What I do is this: > > > >#ifndef O_BINARY > >#define O_BINARY 0 > >#endif > > > >Put that somewhere global, and then *always* use O_BINARY and don't > >worry about it. > > gdb does this, too. It does it in too many (7) places, though. > Shouldn't this be in a header file (defs.h?) somewhere? Perhaps, but this is not the problem I was trying to solve. The issue is whether _any_ platform needs to put O_BINARY into mode in this case. Platforms which define O_BINARY to zero don't need to bother about this, but Windows certainly has a non-zero O_BINARY.