aboutsummaryrefslogtreecommitdiff
path: root/gdb/solib.c
diff options
context:
space:
mode:
authorCharles Wilson <cygwin@cwilson.fastmail.fm>2006-02-25 04:36:39 +0000
committerCharles Wilson <cygwin@cwilson.fastmail.fm>2006-02-25 04:36:39 +0000
commit637d6690a829770987bd4433aacb157fc59ffb77 (patch)
tree9353b781dfa9d5458cd39b152ec56c8a89ec795e /gdb/solib.c
parent83d634e3da41ad929375686dbb12ee4e3ce60101 (diff)
downloadgdb-637d6690a829770987bd4433aacb157fc59ffb77.zip
gdb-637d6690a829770987bd4433aacb157fc59ffb77.tar.gz
gdb-637d6690a829770987bd4433aacb157fc59ffb77.tar.bz2
* 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. * 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
Diffstat (limited to 'gdb/solib.c')
-rw-r--r--gdb/solib.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gdb/solib.c b/gdb/solib.c
index cd81274..1368227 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -171,7 +171,7 @@ solib_open (char *in_pathname, char **found_pathname)
}
/* Now see if we can open it. */
- found_file = open (temp_pathname, O_RDONLY, 0);
+ found_file = open (temp_pathname, O_RDONLY | O_BINARY, 0);
}
/* If the search in solib_absolute_prefix failed, and the path name is
@@ -192,32 +192,32 @@ solib_open (char *in_pathname, char **found_pathname)
/* If not found, search the solib_search_path (if any). */
if (found_file < 0 && solib_search_path != NULL)
found_file = openp (solib_search_path, OPF_TRY_CWD_FIRST,
- in_pathname, O_RDONLY, 0, &temp_pathname);
+ in_pathname, O_RDONLY | O_BINARY, 0, &temp_pathname);
/* If not found, next search the solib_search_path (if any) for the basename
only (ignoring the path). This is to allow reading solibs from a path
that differs from the opened path. */
if (found_file < 0 && solib_search_path != NULL)
found_file = openp (solib_search_path, OPF_TRY_CWD_FIRST,
- lbasename (in_pathname), O_RDONLY, 0,
+ lbasename (in_pathname), O_RDONLY | O_BINARY, 0,
&temp_pathname);
/* If not found, try to use target supplied solib search method */
if (found_file < 0 && ops->find_and_open_solib)
- found_file = ops->find_and_open_solib (in_pathname, O_RDONLY,
+ found_file = ops->find_and_open_solib (in_pathname, O_RDONLY | O_BINARY,
&temp_pathname);
/* If not found, next search the inferior's $PATH environment variable. */
if (found_file < 0 && solib_absolute_prefix == NULL)
found_file = openp (get_in_environ (inferior_environ, "PATH"),
- OPF_TRY_CWD_FIRST, in_pathname, O_RDONLY, 0,
+ OPF_TRY_CWD_FIRST, in_pathname, O_RDONLY | O_BINARY, 0,
&temp_pathname);
/* If not found, next search the inferior's $LD_LIBRARY_PATH
environment variable. */
if (found_file < 0 && solib_absolute_prefix == NULL)
found_file = openp (get_in_environ (inferior_environ, "LD_LIBRARY_PATH"),
- OPF_TRY_CWD_FIRST, in_pathname, O_RDONLY, 0,
+ OPF_TRY_CWD_FIRST, in_pathname, O_RDONLY | O_BINARY, 0,
&temp_pathname);
/* Done. If not found, tough luck. Return found_file and