[COMMIT] Rationalize O_BINARY usage in source.c

Mark Kettenis kettenis@gnu.org
Thu Oct 14 13:24:00 GMT 2004


Another #ifdef _WIN32/__CYGWIN__ bites the dust.

Mark


Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>
 
	* source.c: Always define O_BINARY to 0 if not defined already.
	(openp): Unconditionally use O_BINARY.

 
Index: source.c
===================================================================
RCS file: /cvs/src/src/gdb/source.c,v
retrieving revision 1.58
diff -u -p -r1.58 source.c
--- source.c 30 Sep 2004 19:57:54 -0000 1.58
+++ source.c 14 Oct 2004 13:17:12 -0000
@@ -46,16 +46,16 @@
 #include "ui-out.h"
 #include "readline/readline.h"
 
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+
 #ifdef CRLF_SOURCE_FILES
 
 /* Define CRLF_SOURCE_FILES in an xm-*.h file if source files on the
    host use \r\n rather than just \n.  Defining CRLF_SOURCE_FILES is
    much faster than defining LSEEK_NOT_LINEAR.  */
 
-#ifndef O_BINARY
-#define O_BINARY 0
-#endif
-
 #define OPEN_MODE (O_RDONLY | O_BINARY)
 #define FDOPEN_MODE FOPEN_RB
 
@@ -674,9 +674,7 @@ openp (const char *path, int opts, const
   if (!path)
     path = ".";
 
-#if defined(_WIN32) || defined(__CYGWIN__)
   mode |= O_BINARY;
-#endif
 
   if ((opts & OPF_TRY_CWD_FIRST) || IS_ABSOLUTE_PATH (string))
     {



More information about the Gdb-patches mailing list