Fix reporting of I/O errors in *dprintf functions.
authorUlrich Drepper <drepper@redhat.com>
Thu, 25 Feb 2010 00:07:57 +0000 (16:07 -0800)
committerUlrich Drepper <drepper@redhat.com>
Thu, 25 Feb 2010 00:07:57 +0000 (16:07 -0800)
ChangeLog
libio/iovdprintf.c

index 5271d24..25691cd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,13 @@
 2010-02-24  Ulrich Drepper  <drepper@redhat.com>
 
+       [BZ #11319]
+       * libio/iovdprintf.c (_IO_vdprintf): Explicitly flush stream before
+       undoing the stream because _IO_FINISH doesn't report failures.
+
        [BZ #5553]
        * malloc/malloc.c (public_vALLOc): Set ar_ptr when trying main_arena.
        (public_pVALLOc): Likewise.
+       Patch by Petr Baudis.
 
 2010-02-22  Jim Meyering  <meyering@redhat.com>
 
index edab849..5284ff8 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995, 1997-2000, 2001, 2002, 2003, 2006
+/* Copyright (C) 1995, 1997-2000, 2001, 2002, 2003, 2006, 2010
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -60,6 +60,9 @@ _IO_vdprintf (d, format, arg)
 
   done = INTUSE(_IO_vfprintf) (&tmpfil.file, format, arg);
 
+  if (done != EOF && _IO_do_flush (&tmpfil.file) == EOF)
+    done = EOF;
+
   _IO_FINISH (&tmpfil.file);
 
   return done;