From owner-svn-src-stable@FreeBSD.ORG Sun Aug 17 18:20:39 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DADB87F4 for ; Sun, 17 Aug 2014 18:20:39 +0000 (UTC) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com [209.85.217.172]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F4232723 for ; Sun, 17 Aug 2014 18:20:38 +0000 (UTC) Received: by mail-lb0-f172.google.com with SMTP id z11so3418816lbi.31 for ; Sun, 17 Aug 2014 11:20:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=DFGa97UUExvkgWOWF4X0BBoELAEjKz/xgfcEhMlTuTk=; b=FcC0qLXAk4NPQrwnWHA5ugsm/31Xi1fxT1TRYL9YfYI9leXnes49wSKLue6vL4mJx7 TmSWx/MC7os4GP69A14Mj0e1aiRQenbMK2Q2E/JSO678TCafX6snFFvT355Bemv3vnF9 g9XVET6c42ibbkEP2S+QAFR3zqD17kYHTn8N9bNiRZ+ZudsSFM7htMuOnxc6unyCxhNr W5Y9WYs0JuwR/gL0paJ3i+YBbeLaK3UnLrC4on/W3AxXxTnEBh/ZBgTPviCRqFOHX7ri XP3V4yghVwfQfmAfDHzlDV7SnhGRqfJ/e3tiv9ZZlmY4nfK5A5SBQl8jMDcT7tfTfi1r cXMQ== X-Gm-Message-State: ALoCoQlsr1dp7sKBI1JbGDOqT9c2gMy2kjUCrNzwm2MCGsvoysMxuyyPkc213d5YR5gwfxfQv9Vr X-Received: by 10.112.35.138 with SMTP id h10mr10235390lbj.65.1408299631419; Sun, 17 Aug 2014 11:20:31 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id j20sm23318398lbo.3.2014.08.17.11.20.30 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 17 Aug 2014 11:20:30 -0700 (PDT) Message-ID: <53F0F263.7040202@freebsd.org> Date: Sun, 17 Aug 2014 22:20:19 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: "Pedro F. Giffuni" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: Re: svn commit: r270035 - stable/10/lib/libc/stdio References: <201408160129.s7G1TojV024013@svn.freebsd.org> In-Reply-To: <201408160129.s7G1TojV024013@svn.freebsd.org> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Aug 2014 18:20:39 -0000 On 16.08.2014 5:29, Pedro F. Giffuni wrote: > Author: pfg > Date: Sat Aug 16 01:29:49 2014 > New Revision: 270035 > URL: http://svnweb.freebsd.org/changeset/base/270035 > > Log: > MFC r268924: > Update fflush(3) to return success on a read-only stream. > > This is done for compliance with SUSv3. The changes cause > no secondary effects in the gnulib tests (we pass them). ... > @@ -122,6 +123,12 @@ __sflush(FILE *fp) > for (; n > 0; n -= t, p += t) { > t = _swrite(fp, (char *)p, n); > if (t <= 0) { > + /* Reset _p and _w. */ > + if (p > fp->_p) /* Some was written. */ > + memmove(fp->_p, p, n); > + fp->_p += n; > + if ((fp->_flags & (__SLBF | __SNBF)) == 0) > + fp->_w -= n; > fp->_flags |= __SERR; > return (EOF); > } > The description is incomplete. This code also does internal stdio structure adjustment for partial write. -- http://ache.vniz.net/