From owner-svn-src-all@FreeBSD.ORG Wed Jun 13 03:30:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E382A10656E9; Wed, 13 Jun 2012 03:30:24 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CED008FC18; Wed, 13 Jun 2012 03:30:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5D3UOwr092683; Wed, 13 Jun 2012 03:30:24 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5D3UOoK092681; Wed, 13 Jun 2012 03:30:24 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201206130330.q5D3UOoK092681@svn.freebsd.org> From: Eitan Adler Date: Wed, 13 Jun 2012 03:30:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236982 - stable/8/lib/libc/stdio X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2012 03:30:25 -0000 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);