From 5d1d95de0ef952f316f5cd5c5ced2fc46ea082a9 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Fri, 9 Aug 2002 16:36:10 +0000 Subject: [PATCH] * cli/cli-dump.c: Change fopen modes to use binary open modes as defined in include/fopen-bin.h throughout. --- gdb/ChangeLog | 5 +++++ gdb/cli/cli-dump.c | 26 +++++++++++++------------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 96c422a0e5c..673a6291e3c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2002-08-09 Corinna Vinschen + + * cli/cli-dump.c: Change fopen modes to use binary open modes + as defined in include/fopen-bin.h throughout. + 2002-08-08 Michael Snyder * mips-tdep.c: Minor whitespace and indentation clean-ups. diff --git a/gdb/cli/cli-dump.c b/gdb/cli/cli-dump.c index 7aa60925d65..a648093dd47 100644 --- a/gdb/cli/cli-dump.c +++ b/gdb/cli/cli-dump.c @@ -360,61 +360,61 @@ dump_filetype (char *cmd, char *mode, char *filetype) static void dump_srec_memory (char *args, int from_tty) { - dump_memory_to_file (args, "w", "srec"); + dump_memory_to_file (args, FOPEN_WB, "srec"); } static void dump_srec_value (char *args, int from_tty) { - dump_value_to_file (args, "w", "srec"); + dump_value_to_file (args, FOPEN_WB, "srec"); } static void dump_ihex_memory (char *args, int from_tty) { - dump_memory_to_file (args, "w", "ihex"); + dump_memory_to_file (args, FOPEN_WB, "ihex"); } static void dump_ihex_value (char *args, int from_tty) { - dump_value_to_file (args, "w", "ihex"); + dump_value_to_file (args, FOPEN_WB, "ihex"); } static void dump_tekhex_memory (char *args, int from_tty) { - dump_memory_to_file (args, "w", "tekhex"); + dump_memory_to_file (args, FOPEN_WB, "tekhex"); } static void dump_tekhex_value (char *args, int from_tty) { - dump_value_to_file (args, "w", "tekhex"); + dump_value_to_file (args, FOPEN_WB, "tekhex"); } static void dump_binary_memory (char *args, int from_tty) { - dump_memory_to_file (args, "w", "binary"); + dump_memory_to_file (args, FOPEN_WB, "binary"); } static void dump_binary_value (char *args, int from_tty) { - dump_value_to_file (args, "w", "binary"); + dump_value_to_file (args, FOPEN_WB, "binary"); } static void append_binary_memory (char *args, int from_tty) { - dump_memory_to_file (args, "a", "binary"); + dump_memory_to_file (args, FOPEN_AB, "binary"); } static void append_binary_value (char *args, int from_tty) { - dump_value_to_file (args, "a", "binary"); + dump_value_to_file (args, FOPEN_AB, "binary"); } struct dump_context @@ -442,7 +442,7 @@ add_dump_command (char *name, void (*func) (char *args, char *mode), c->completer = filename_completer; d = XMALLOC (struct dump_context); d->func = func; - d->mode = "wb"; + d->mode = FOPEN_WB; set_cmd_context (c, d); c->func = call_dump_func; @@ -450,7 +450,7 @@ add_dump_command (char *name, void (*func) (char *args, char *mode), c->completer = filename_completer; d = XMALLOC (struct dump_context); d->func = func; - d->mode = "ab"; + d->mode = FOPEN_AB; set_cmd_context (c, d); c->func = call_dump_func; @@ -547,7 +547,7 @@ restore_section_callback (bfd *ibfd, asection *isec, void *args) static void restore_binary_file (char *filename, struct callback_data *data) { - FILE *file = fopen_with_cleanup (filename, "r"); + FILE *file = fopen_with_cleanup (filename, FOPEN_RB); int status; char *buf; long len; -- 2.30.2