* cache.c (cache_bread): Set bfd_error_file_truncated if EOF
[deliverable/binutils-gdb.git] / bfd / vms-misc.c
index 30462ba640bd006caf3f1f4dddff997badf06d25..98fbb0e299719c3217506f42cd10e1f549e718d5 100644 (file)
@@ -1,13 +1,13 @@
 /* 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
-   Free Software Foundation, Inc.
+   Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+   2007 Free Software Foundation, Inc.
 
    Written by Klaus K"ampf (kkaempf@rmi.de)
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02110-1301, USA.  */
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
 
 #if __STDC__
 #include <stdarg.h>
 #endif
 
-#include "bfd.h"
 #include "sysdep.h"
+#include "bfd.h"
 #include "bfdlink.h"
 #include "libbfd.h"
 
@@ -690,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;
     }
This page took 0.024361 seconds and 4 git commands to generate.