Make sure to call fflush if estream_t is backed with stdio
authorDaiki Ueno <ueno@gnu.org>
Tue, 2 Apr 2013 06:45:58 +0000 (15:45 +0900)
committerWerner Koch <wk@gnupg.org>
Fri, 19 Apr 2013 10:16:56 +0000 (12:16 +0200)
* common/estream.c (es_func_fp_write): Call fflush after fwrite.

common/estream.c

index 79fa405..79e3efb 100644 (file)
@@ -1275,6 +1275,7 @@ es_func_fp_write (void *cookie, const void *buffer, size_t size)
 #else
       bytes_written = fwrite (buffer, 1, size, file_cookie->fp);
 #endif
+      fflush (file_cookie->fp);
     }
   else
     bytes_written = size; /* Successfully written to the bit bucket.  */