svn commit: r236981 - stable/7/lib/libc/stdio

Eitan Adler eadler at FreeBSD.org
Wed Jun 13 03:29:58 UTC 2012


Author: eadler
Date: Wed Jun 13 03:29:57 2012
New Revision: 236981
URL: http://svn.freebsd.org/changeset/base/236981

Log:
  MFC r236288:
  	Only set _w to 0 when the file stream is not currently reading. Without this fflush may fail to write data in the buffer.
  
  PR:		kern/137819
  Approved by:	cperciva (implicit)

Modified:
  stable/7/lib/libc/stdio/fpurge.c
Directory Properties:
  stable/7/lib/libc/   (props changed)

Modified: stable/7/lib/libc/stdio/fpurge.c
==============================================================================
--- stable/7/lib/libc/stdio/fpurge.c	Wed Jun 13 03:19:11 2012	(r236980)
+++ stable/7/lib/libc/stdio/fpurge.c	Wed Jun 13 03:29:57 2012	(r236981)
@@ -62,7 +62,7 @@ fpurge(fp)
 			FREEUB(fp);
 		fp->_p = fp->_bf._base;
 		fp->_r = 0;
-		fp->_w = fp->_flags & (__SLBF|__SNBF) ? 0 : fp->_bf._size;
+		fp->_w = fp->_flags & (__SLBF|__SNBF|__SRD) ? 0 : fp->_bf._size;
 		retval = 0;
 	}
 	FUNLOCKFILE(fp);


More information about the svn-src-stable-7 mailing list