* opncls.c (bfd_fopen): Always close fd on failure.
	(bfd_fdopenr): Likewise.
gdb/
	* symfile.c (symfile_bfd_open): Don't close desc if bfd_fopen
	fails.
	* solib.c (solib_bfd_fopen): Don't close fd if bfd_fopen fails.
	* exec.c (exec_file_attach): Don't close scratch_chan if bfd_fopen
	fails.
	* dwarf2read.c (try_open_dwo_file): Don't close fd if bfd_fopen
	fails.
This commit is contained in:
Tom Tromey
2012-05-29 14:23:40 +00:00
parent ec95993ca4
commit 6f0c7050fc
7 changed files with 31 additions and 7 deletions

View File

@@ -238,7 +238,6 @@ exec_file_attach (char *filename, int from_tty)
if (!exec_bfd)
{
close (scratch_chan);
error (_("\"%s\": could not open as an executable file: %s"),
scratch_pathname, bfd_errmsg (bfd_get_error ()));
}