#include "gdbcore.h"
#include "gdbthread.h"
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+
/* List of all available core_fns. On gdb startup, each core file register
reader calls add_core_fns() to register information on each core format it
is prepared to read. */
/* Walk through the list of core functions to find a set that can
handle the core file open on ABFD. Default to the first one in the
- list of nothing matches. Returns pointer to set that is
+ list if nothing matches. Returns pointer to set that is
selected. */
static struct core_fns *
old_chain = make_cleanup (free, filename);
- scratch_chan = open (filename, write_files ? O_RDWR : O_RDONLY, 0);
+ scratch_chan = open (filename, O_BINARY | ( write_files ? O_RDWR : O_RDONLY ), 0);
if (scratch_chan < 0)
perror_with_name (filename);
siggy = bfd_core_file_failing_signal (core_bfd);
if (siggy > 0)
/* NOTE: target_signal_from_host() converts a target signal value
- into gdb's internal signal value. Unfortunatly gdb's internal
+ into gdb's internal signal value. Unfortunately gdb's internal
value is called ``target_signal'' and this function got the
name ..._from_host(). */
printf_filtered ("Program terminated with signal %d, %s.\n", siggy,