Fix -Wuninitialized warnings.
[deliverable/binutils-gdb.git] / gdb / corelow.c
index b5526004c1914b0514ce4ec07fdbf9f0f45d3033..148f5f4440006f9513396fb7f27b87c0fe25881e 100644 (file)
 #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. */
@@ -105,7 +109,7 @@ default_core_sniffer (struct core_fns *our_fns, bfd *abfd)
 
 /* 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 *
@@ -275,7 +279,7 @@ core_open (char *filename, int from_tty)
 
   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);
 
@@ -325,7 +329,7 @@ core_open (char *filename, int from_tty)
   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,
This page took 0.023093 seconds and 4 git commands to generate.