aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2004-07-06 14:24:06 +0000
committerAndrew Cagney <cagney@redhat.com>2004-07-06 14:24:06 +0000
commitee28ca0fd66a9752c9dbf8717ab425cabb9a8aa3 (patch)
tree70c08c06ac38bd0be97320aa886a56eb76a179d6 /gdb
parentb8b50ea9bd0321c6817455819668b1dff3fbd5e2 (diff)
downloadgdb-ee28ca0fd66a9752c9dbf8717ab425cabb9a8aa3.zip
gdb-ee28ca0fd66a9752c9dbf8717ab425cabb9a8aa3.tar.gz
gdb-ee28ca0fd66a9752c9dbf8717ab425cabb9a8aa3.tar.bz2
2004-07-06 Andrew Cagney <cagney@gnu.org>
Patch from Bart Robinson. * corelow.c (core_open): Add variable "flags", or in O_LARGEFILE. (O_LARGEFILE): Define to 0, if not defined.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/corelow.c12
2 files changed, 17 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index b8105b9..d16379d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2004-07-06 Andrew Cagney <cagney@gnu.org>
+
+ Patch from Bart Robinson.
+ * corelow.c (core_open): Add variable "flags", or in O_LARGEFILE.
+ (O_LARGEFILE): Define to 0, if not defined.
+
2004-07-03 Mark Kettenis <kettenis@gnu.org>
* m68kbsd-nat.c: Include "gdbcore.h", <sys/types.h>,
diff --git a/gdb/corelow.c b/gdb/corelow.c
index 4c6a40c..a9d2132 100644
--- a/gdb/corelow.c
+++ b/gdb/corelow.c
@@ -50,6 +50,10 @@
#define O_BINARY 0
#endif
+#ifndef O_LARGEFILE
+#define O_LARGEFILE 0
+#endif
+
/* List of all available core_fns. On gdb startup, each core file
register reader calls deprecated_add_core_fns() to register
information on each core format it is prepared to read. */
@@ -280,6 +284,7 @@ core_open (char *filename, int from_tty)
bfd *temp_bfd;
int ontop;
int scratch_chan;
+ int flags;
target_preopen (from_tty);
if (!filename)
@@ -299,7 +304,12 @@ core_open (char *filename, int from_tty)
old_chain = make_cleanup (xfree, filename);
- scratch_chan = open (filename, O_BINARY | ( write_files ? O_RDWR : O_RDONLY ), 0);
+ flags = O_BINARY | O_LARGEFILE;
+ if (write_files)
+ flags |= O_RDWR;
+ else
+ flags |= O_RDONLY;
+ scratch_chan = open (filename, flags, 0);
if (scratch_chan < 0)
perror_with_name (filename);