Date: Wed, 13 Jun 2012 03:30:24 +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-8@freebsd.org Subject: svn commit: r236982 - stable/8/lib/libc/stdio Message-ID: <201206130330.q5D3UOoK092681@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: eadler Date: Wed Jun 13 03:30:24 2012 New Revision: 236982 URL: http://svn.freebsd.org/changeset/base/236982 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/8/lib/libc/stdio/fpurge.c Directory Properties: stable/8/lib/libc/ (props changed) Modified: stable/8/lib/libc/stdio/fpurge.c ============================================================================== --- stable/8/lib/libc/stdio/fpurge.c Wed Jun 13 03:29:57 2012 (r236981) +++ stable/8/lib/libc/stdio/fpurge.c Wed Jun 13 03:30:24 2012 (r236982) @@ -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?201206130330.q5D3UOoK092681>