* 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

@@ -380,8 +380,6 @@ solib_bfd_fopen (char *pathname, int fd)
if (abfd)
bfd_set_cacheable (abfd, 1);
else if (fd != -1)
close (fd);
}
if (!abfd)