Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Jun 2012 03:29:57 +0000 (UTC)
From:      Eitan Adler <eadler@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r236981 - stable/7/lib/libc/stdio
Message-ID:  <201206130329.q5D3Tv8O092618@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201206130329.q5D3Tv8O092618>