Ignore:
Timestamp:
Aug 16, 2003, 6:59:22 PM (22 years ago)
Author:
bird
Message:

binutils v2.14 - offical sources.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GNU/src/binutils/gas/output-file.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r608 r609  
    11/* output-file.c -  Deal with the output file
    2    Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1996, 1998, 1999
     2   Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1996, 1998, 1999, 2001
    33   Free Software Foundation, Inc.
    44
     
    1717   You should have received a copy of the GNU General Public License
    1818   along with GAS; see the file COPYING.  If not, write to
    19    the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
     19   the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
     20   02111-1307, USA.  */
    2021
    2122#include <stdio.h>
     
    4546{
    4647  if (name[0] == '-' && name[1] == '\0')
    47     {
    48       as_fatal (_("Can't open a bfd on stdout %s "), name);
    49     }
     48    as_fatal (_("can't open a bfd on stdout %s"), name);
     49
    5050  else if (!(stdoutput = bfd_openw (name, TARGET_FORMAT)))
    5151    {
    52       as_perror (_("FATAL: Can't create %s"), name);
     52      as_perror (_("FATAL: can't create %s"), name);
    5353      exit (EXIT_FAILURE);
    5454    }
     55
    5556  bfd_set_format (stdoutput, bfd_object);
    5657#ifdef BFD_ASSEMBLER
     
    7071    {
    7172      bfd_perror (filename);
    72       as_perror (_("FATAL: Can't close %s\n"), filename);
     73      as_perror (_("FATAL: can't close %s\n"), filename);
    7374      exit (EXIT_FAILURE);
    7475    }
    7576#else
    76   /* Close the bfd without getting bfd to write out anything by itself */
     77  /* Close the bfd without getting bfd to write out anything by itself. */
    7778  if (bfd_close_all_done (stdoutput) == 0)
    7879    {
    79       as_perror (_("FATAL: Can't close %s\n"), filename);
     80      as_perror (_("FATAL: can't close %s\n"), filename);
    8081      exit (EXIT_FAILURE);
    8182    }
    8283#endif
    83   stdoutput = NULL;             /* Trust nobody! */
     84  stdoutput = NULL;             /* Trust nobody!  */
    8485}
    8586
     
    109110    }
    110111
    111   stdoutput = fopen (name, "wb");
    112 
    113   /* Some systems don't grok "b" in fopen modes.  */
    114   if (stdoutput == NULL)
    115     stdoutput = fopen (name, "w");
    116 
     112  stdoutput = fopen (name, FOPEN_WB);
    117113  if (stdoutput == NULL)
    118114    {
    119       as_perror (_("FATAL: Can't create %s"), name);
     115      as_perror (_("FATAL: can't create %s"), name);
    120116      exit (EXIT_FAILURE);
    121117    }
     
    128124  if (EOF == fclose (stdoutput))
    129125    {
    130       as_perror (_("FATAL: Can't close %s"), filename);
     126      as_perror (_("FATAL: can't close %s"), filename);
    131127      exit (EXIT_FAILURE);
    132128    }
    133   stdoutput = NULL;             /* Trust nobody! */
     129
     130  /* Trust nobody!  */
     131  stdoutput = NULL;
    134132}
    135133
    136134void
    137135output_file_append (where, length, filename)
    138      char *where;
    139      long length;
    140      char *filename;
     136     char * where;
     137     long   length;
     138     char * filename;
    141139{
    142140  for (; length; length--, where++)
    143141    {
    144142      (void) putc (*where, stdoutput);
     143
    145144      if (ferror (stdoutput))
    146145        /* if ( EOF == (putc( *where, stdoutput )) ) */
    147146        {
    148147          as_perror (_("Failed to emit an object byte"), filename);
    149           as_fatal (_("Can't continue"));
     148          as_fatal (_("can't continue"));
    150149        }
    151150    }
     
    154153#endif
    155154
    156 /* end of output-file.c */
Note: See TracChangeset for help on using the changeset viewer.