aboutsummaryrefslogtreecommitdiff
path: root/gdb/exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/exec.c')
-rw-r--r--gdb/exec.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gdb/exec.c b/gdb/exec.c
index de1b0b6..2bd3181 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -230,9 +230,11 @@ exec_file_attach (char *filename, int from_tty)
if (scratch_chan < 0)
perror_with_name (filename);
- exec_bfd = gdb_bfd_fopen (scratch_pathname, gnutarget,
- write_files ? FOPEN_RUB : FOPEN_RB,
- scratch_chan);
+ if (write_files)
+ exec_bfd = gdb_bfd_fopen (scratch_pathname, gnutarget,
+ FOPEN_RUB, scratch_chan);
+ else
+ exec_bfd = gdb_bfd_open (scratch_pathname, gnutarget, scratch_chan);
if (!exec_bfd)
{