summaryrefslogtreecommitdiff
path: root/gdb/corelow.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/corelow.c')
-rw-r--r--gdb/corelow.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gdb/corelow.c b/gdb/corelow.c
index 3e70ed4bfae..c07b5749716 100644
--- a/gdb/corelow.c
+++ b/gdb/corelow.c
@@ -316,7 +316,9 @@ core_open (char *filename, int from_tty)
if (scratch_chan < 0)
perror_with_name (filename);
- temp_bfd = bfd_fdopenr (filename, gnutarget, scratch_chan);
+ temp_bfd = bfd_fopen (filename, gnutarget,
+ write_files ? FOPEN_RUB : FOPEN_RB,
+ scratch_chan);
if (temp_bfd == NULL)
perror_with_name (filename);