This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[commit] Fix file open error recovery in hw_com
- From: Andrew Cagney <ac131313 at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Sat, 21 Jun 2003 20:53:04 -0400
- Subject: [commit] Fix file open error recovery in hw_com
I've checked this fix in. Thanks to masahino for finding this.
Andrew
2003-06-21 Andrew Cagney <cagney@redhat.com>
* hw_com.c (hw_com_device_init_data): Check that the output, and
not input file opened. Pointed out by masahino tky3.3web.ne.jp.
Index: hw_com.c
===================================================================
RCS file: /cvs/src/src/sim/ppc/hw_com.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 hw_com.c
--- hw_com.c 16 Apr 1999 01:35:09 -0000 1.1.1.1
+++ hw_com.c 22 Jun 2003 00:49:37 -0000
@@ -249,7 +249,7 @@
if (device_find_property(me, "output-file") != NULL) {
const char *output_file = device_find_string_property(me, "output-file");
com->output.file = fopen(output_file, "w");
- if (com->input.file == NULL)
+ if (com->output.file == NULL)
device_error(me, "Problem opening output file %s\n", output_file);
if (device_find_property(me, "output-buffering") != NULL) {
const char *buffering = device_find_string_property(me, "output-buffering");