Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 May 2012 04:06:39 +0000 (UTC)
From:      Eitan Adler <eadler@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r236288 - head/lib/libc/stdio
Message-ID:  <201205300406.q4U46d5W024887@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: eadler
Date: Wed May 30 04:06:38 2012
New Revision: 236288
URL: http://svn.freebsd.org/changeset/base/236288

Log:
  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
  Submitted by:	Eric Blake <ebb9@byu.net>
  Reviewed by:	theraven
  Approved by:	cperciva
  MFC after:	2 weeks

Modified:
  head/lib/libc/stdio/fpurge.c

Modified: head/lib/libc/stdio/fpurge.c
==============================================================================
--- head/lib/libc/stdio/fpurge.c	Wed May 30 03:57:49 2012	(r236287)
+++ head/lib/libc/stdio/fpurge.c	Wed May 30 04:06:38 2012	(r236288)
@@ -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?201205300406.q4U46d5W024887>