svn commit: r236983 - stable/9/lib/libc/stdio

Eitan Adler eadler at FreeBSD.org
Wed Jun 13 03:34:43 UTC 2012


Author: eadler
Date: Wed Jun 13 03:34:42 2012
New Revision: 236983
URL: http://svn.freebsd.org/changeset/base/236983

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/9/lib/libc/stdio/fpurge.c
Directory Properties:
  stable/9/lib/libc/   (props changed)

Modified: stable/9/lib/libc/stdio/fpurge.c
==============================================================================
--- stable/9/lib/libc/stdio/fpurge.c	Wed Jun 13 03:30:24 2012	(r236982)
+++ stable/9/lib/libc/stdio/fpurge.c	Wed Jun 13 03:34:42 2012	(r236983)
@@ -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-9 mailing list