RFA: ensure binary objects opened in binary mode

Charles Wilson cygwin@cwilson.fastmail.fm
Fri Feb 24 10:37:00 GMT 2006


Daniel Jacobowitz wrote:
> On Wed, Feb 22, 2006 at 08:34:54PM +0200, Eli Zaretskii wrote:
>>> (1) for every file that #includes both defs.h AND <fcntl.h>, remove the 
>>> <fcntl.h> inclusion.
[snip]
>> So I'd prefer if you committed the 1st and the 3rd patch. but not the
>> second.  However, before you actually do that, let's wait and hear
>> what others think.
> 
> Fine by me.
> 
>>> +/* In case this is not defined in fcntl.h */
>>> +
>>> +#ifndef O_BINARY
>>> +#define O_BINARY 0
>>> +#endif
>> I'd change the comment to explain that O_BINARY has a meaning on
>> non-Posix platforms, while on Posix platforms it should be a no-op.
>> That is the _real_ reason we define O_BINARY.
> 
> Ditto.
> 

Alrighty then -- here's the next iteration.  Both parts have changed a 
bit: the first patch no longer removes #include <fcntl.h> from solib.c, 
while the second patch ONLY addresses the #ifndef O_BINARY clutter and 
no longer removes <fcntl.h> from the 48 files.

Patch 1:
  defs.h  |   12 ++++++++++++
  solib.c |   12 ++++++------
  2 files changed, 18 insertions(+), 6 deletions(-)

2006-02-24  Charles Wilson  <cygwin@...>

	* gdb/defs.h: unconditionally include <fcntl.h>, and
	ensure that O_BINARY is defined.
	* gdb/solib.c(solib_open): ensure solib files are opened in
	binary mode.

Patch 2:
  corelow.c    |    3 ---
  exec.c       |    3 ---
  remote-rdp.c |    3 ---
  source.c     |    3 ---
  symfile.c    |    3 ---
  5 files changed, 15 deletions(-)

2006-02-24  Charles Wilson  <cygwin@...>

	* gdb/corelow.c: Remove O_BINARY macro definition.
	* gdb/exec.c: Remove O_BINARY macro definition
	* gdb/remote-rdp.c: Remove O_BINARY macro definition
	* gdb/source.c: Remove O_BINARY macro definition
	* gdb/symfile.c: Remove O_BINARY macro definition

Per cgf's earlier message, I can go ahead and check this in myself 
assuming everybody's happy with it at this point?

--
Chuck
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: gdb-6.4.50.20060131-cvs.solib.patch-attempt3-part1
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20060224/dc903663/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: gdb-6.4.50.20060131-cvs.solib.patch-attempt3-part2
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20060224/dc903663/attachment-0001.ksh>


More information about the Gdb-patches mailing list