(_IO_flush_all_linebuffered): Don't flush on a read-only stream.
authordrepper <drepper>
Fri, 11 Apr 1997 09:29:33 +0000 (09:29 +0000)
committerdrepper <drepper>
Fri, 11 Apr 1997 09:29:33 +0000 (09:29 +0000)
libio/genops.c

index db7fb18..c085986 100644 (file)
@@ -615,7 +615,7 @@ DEFUN_VOID(_IO_flush_all_linebuffered)
 {
   _IO_FILE *fp;
   for (fp = _IO_list_all; fp != NULL; fp = fp->_chain)
-    if (fp->_flags & _IO_LINE_BUF)
+    if ((fp->_flags & _IO_NO_WRITES) == 0 && fp->_flags & _IO_LINE_BUF)
       _IO_OVERFLOW (fp, EOF);
 }