X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=bfd%2Fvms-misc.c;h=87f7ce8088b9cd2cd0f5fa9139beaa8342c86557;hb=19a6653ce8c6d8a76586a54f3c0396063de5f987;hp=1492f146ff0e5316713f8716dca6c19e362a1ba1;hpb=cd123cb70c845b890eed231a84e6e84c92c2ef92;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/vms-misc.c b/bfd/vms-misc.c index 1492f146ff..87f7ce8088 100644 --- a/bfd/vms-misc.c +++ b/bfd/vms-misc.c @@ -1,7 +1,7 @@ /* vms-misc.c -- Miscellaneous functions for VAX (openVMS/VAX) and EVAX (openVMS/Alpha) files. Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, - 2007 Free Software Foundation, Inc. + 2007, 2008 Free Software Foundation, Inc. Written by Klaus K"ampf (kkaempf@rmi.de) @@ -349,7 +349,7 @@ _bfd_vms_get_record (bfd * abfd) if (PRIV (rec_length) > PRIV (buf_size)) { - PRIV (vms_buf) = bfd_realloc (vms_buf, + PRIV (vms_buf) = bfd_realloc_or_free (vms_buf, (bfd_size_type) PRIV (rec_length)); vms_buf = PRIV (vms_buf); if (vms_buf == 0) @@ -691,12 +691,17 @@ _bfd_vms_output_flush (bfd * abfd) if (PRIV (push_level) == 0) { + if (0 #ifndef VMS - /* Write length first, see FF_FOREIGN in the input routines. */ - fwrite (PRIV (output_buf) + 2, 2, 1, (FILE *) abfd->iostream); -#endif - fwrite (PRIV (output_buf), (size_t) real_size, 1, - (FILE *) abfd->iostream); + /* Write length first, see FF_FOREIGN in the input routines. */ + || fwrite (PRIV (output_buf) + 2, 2, 1, + (FILE *) abfd->iostream) != 1 +#endif + || (real_size != 0 + && fwrite (PRIV (output_buf), (size_t) real_size, 1, + (FILE *) abfd->iostream) != 1)) + /* FIXME: Return error status. */ + abort (); PRIV (output_size) = 0; }