summaryrefslogtreecommitdiff
path: root/gdb/source.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2004-10-14 13:19:30 +0000
committerMark Kettenis <kettenis@gnu.org>2004-10-14 13:19:30 +0000
commit3d807db040f0bac56fb80edc888436c738ac005f (patch)
tree2e5d95d0692ec720d594fab8893a943ad656e16c /gdb/source.c
parente94ade8cacf245c3b4afe1b60d4f7e185d16f8ae (diff)
downloadgdb-3d807db040f0bac56fb80edc888436c738ac005f.tar.gz
* source.c: Always define O_BINARY to 0 if not defined already.
(openp): Unconditionally use O_BINARY.
Diffstat (limited to 'gdb/source.c')
-rw-r--r--gdb/source.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/gdb/source.c b/gdb/source.c
index e2b6fa90f67..f0dc5542b8e 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -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 char *string,
if (!path)
path = ".";
-#if defined(_WIN32) || defined(__CYGWIN__)
mode |= O_BINARY;
-#endif
if ((opts & OPF_TRY_CWD_FIRST) || IS_ABSOLUTE_PATH (string))
{