* output-file.c (output_file_close): Prevent an infinite loop reporting that stdoutput could not be closed.
This commit is contained in:
parent
49c13adb16
commit
df3ca5a38e
2 changed files with 17 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2006-09-27 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
|
* output-file.c (output_file_close): Prevent an infinite loop
|
||||||
|
reporting that stdoutput could not be closed.
|
||||||
|
|
||||||
2006-09-26 Mark Shinwell <shinwell@codesourcery.com>
|
2006-09-26 Mark Shinwell <shinwell@codesourcery.com>
|
||||||
Joseph Myers <joseph@codesourcery.com>
|
Joseph Myers <joseph@codesourcery.com>
|
||||||
Ian Lance Taylor <ian@wasabisystems.com>
|
Ian Lance Taylor <ian@wasabisystems.com>
|
||||||
|
|
|
@ -53,9 +53,19 @@ output_file_create (char *name)
|
||||||
void
|
void
|
||||||
output_file_close (char *filename)
|
output_file_close (char *filename)
|
||||||
{
|
{
|
||||||
|
bfd_boolean res;
|
||||||
|
|
||||||
|
if (stdoutput == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
/* Close the bfd. */
|
/* Close the bfd. */
|
||||||
if (!bfd_close (stdoutput))
|
res = bfd_close (stdoutput);
|
||||||
|
|
||||||
|
/* Prevent an infinite loop - if the close failed we will call as_fatal
|
||||||
|
which will call xexit() which may call this function again... */
|
||||||
|
stdoutput = NULL;
|
||||||
|
|
||||||
|
if (! res)
|
||||||
as_fatal (_("can't close %s: %s"), filename,
|
as_fatal (_("can't close %s: %s"), filename,
|
||||||
bfd_errmsg (bfd_get_error ()));
|
bfd_errmsg (bfd_get_error ()));
|
||||||
stdoutput = NULL; /* Trust nobody! */
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue