From 2504df11e1275f63f4c53377bf91eee996360cb5 Mon Sep 17 00:00:00 2001 From: obrien Date: Wed, 16 Jun 2004 05:45:41 +0000 Subject: Import of Binutils from the FSF 2.15 branch (just post-.0 release). These bits are taken from the FSF anoncvs repo on 23-May-2004 04:41:00 UTC. --- contrib/binutils/gas/output-file.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'contrib/binutils/gas/output-file.c') diff --git a/contrib/binutils/gas/output-file.c b/contrib/binutils/gas/output-file.c index 531e35f..4c376b4 100644 --- a/contrib/binutils/gas/output-file.c +++ b/contrib/binutils/gas/output-file.c @@ -1,5 +1,5 @@ /* output-file.c - Deal with the output file - Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1996, 1998, 1999, 2001 + Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1996, 1998, 1999, 2001, 2003 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -41,8 +41,7 @@ bfd *stdoutput; void -output_file_create (name) - char *name; +output_file_create (char *name) { if (name[0] == '-' && name[1] == '\0') as_fatal (_("can't open a bfd on stdout %s"), name); @@ -62,8 +61,7 @@ output_file_create (name) } void -output_file_close (filename) - char *filename; +output_file_close (char *filename) { #ifdef BFD_ASSEMBLER /* Close the bfd. */ @@ -86,10 +84,9 @@ output_file_close (filename) #ifndef BFD_ASSEMBLER void -output_file_append (where, length, filename) - char *where ATTRIBUTE_UNUSED; - long length ATTRIBUTE_UNUSED; - char *filename ATTRIBUTE_UNUSED; +output_file_append (char *where ATTRIBUTE_UNUSED, + long length ATTRIBUTE_UNUSED, + char *filename ATTRIBUTE_UNUSED) { abort (); } @@ -100,8 +97,7 @@ output_file_append (where, length, filename) static FILE *stdoutput; void -output_file_create (name) - char *name; +output_file_create (char *name) { if (name[0] == '-' && name[1] == '\0') { @@ -112,17 +108,22 @@ output_file_create (name) stdoutput = fopen (name, FOPEN_WB); if (stdoutput == NULL) { +#ifdef BFD_ASSEMBLER + bfd_set_error (bfd_error_system_call); +#endif as_perror (_("FATAL: can't create %s"), name); exit (EXIT_FAILURE); } } void -output_file_close (filename) - char *filename; +output_file_close (char *filename) { if (EOF == fclose (stdoutput)) { +#ifdef BFD_ASSEMBLER + bfd_set_error (bfd_error_system_call); +#endif as_perror (_("FATAL: can't close %s"), filename); exit (EXIT_FAILURE); } @@ -132,18 +133,17 @@ output_file_close (filename) } void -output_file_append (where, length, filename) - char * where; - long length; - char * filename; +output_file_append (char * where, long length, char * filename) { for (; length; length--, where++) { (void) putc (*where, stdoutput); if (ferror (stdoutput)) - /* if ( EOF == (putc( *where, stdoutput )) ) */ { +#ifdef BFD_ASSEMBLER + bfd_set_error (bfd_error_system_call); +#endif as_perror (_("Failed to emit an object byte"), filename); as_fatal (_("can't continue")); } -- cgit v1.1