aboutsummaryrefslogtreecommitdiff
path: root/gas/output-file.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2006-09-22 11:35:14 +0000
committerAlan Modra <amodra@gmail.com>2006-09-22 11:35:14 +0000
commit885afe7b6fda4324ac445cfdd9e37630f5061dc0 (patch)
tree2f435abf11a454bf8ba62f2534fa2520b6b00a13 /gas/output-file.c
parent3aeeedbb71f648211ae2efde0d0cf4b24abcefe1 (diff)
downloadgdb-885afe7b6fda4324ac445cfdd9e37630f5061dc0.zip
gdb-885afe7b6fda4324ac445cfdd9e37630f5061dc0.tar.gz
gdb-885afe7b6fda4324ac445cfdd9e37630f5061dc0.tar.bz2
* as.h (as_perror): Delete declaration.
* gdbinit.in (as_perror): Delete breakpoint. * messages.c (as_perror): Delete function. * doc/internals.texi: Remove as_perror description. * listing.c (listing_print: Don't use as_perror. * output-file.c (output_file_create, output_file_close): Likewise. * symbols.c (symbol_create, symbol_clone): Likewise. * write.c (write_contents): Likewise. * config/obj-som.c (obj_som_version, obj_som_copyright): Likewise. * config/tc-tic54x.c (tic54x_mlib): Likewise.
Diffstat (limited to 'gas/output-file.c')
-rw-r--r--gas/output-file.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/gas/output-file.c b/gas/output-file.c
index 446af30..dfbef1f 100644
--- a/gas/output-file.c
+++ b/gas/output-file.c
@@ -36,11 +36,12 @@ output_file_create (char *name)
else if (!(stdoutput = bfd_openw (name, TARGET_FORMAT)))
{
- if (bfd_get_error () == bfd_error_invalid_target)
- as_perror (_("Selected target format '%s' unknown"), TARGET_FORMAT);
+ bfd_error_type err = bfd_get_error ();
+
+ if (err == bfd_error_invalid_target)
+ as_fatal (_("selected target format '%s' unknown"), TARGET_FORMAT);
else
- as_perror (_("FATAL: can't create %s"), name);
- exit (EXIT_FAILURE);
+ as_fatal (_("can't create %s: %s"), name, bfd_errmsg (err));
}
bfd_set_format (stdoutput, bfd_object);
@@ -53,11 +54,8 @@ void
output_file_close (char *filename)
{
/* Close the bfd. */
- if (bfd_close (stdoutput) == 0)
- {
- bfd_perror (filename);
- as_perror (_("FATAL: can't close %s\n"), filename);
- exit (EXIT_FAILURE);
- }
+ if (!bfd_close (stdoutput))
+ as_fatal (_("can't close %s: %s"), filename,
+ bfd_errmsg (bfd_get_error ()));
stdoutput = NULL; /* Trust nobody! */
}