From owner-svn-src-stable-10@FreeBSD.ORG Sun Aug 17 18:20:39 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E1DBA7F7 for ; Sun, 17 Aug 2014 18:20:39 +0000 (UTC) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com [209.85.217.177]) (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 5F5A32726 for ; Sun, 17 Aug 2014 18:20:38 +0000 (UTC) Received: by mail-lb0-f177.google.com with SMTP id s7so3398390lbd.22 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=FHWZkmiy3ddrk3Y3aCOMkeV4vGo7WX4uHJT1rH0HeONimqUbm1HP3ar5ezNYPtSSey VMhJ0iwVQiuedOkFxA3oAzaeBTvjJ6hLFVYqpWh9P1kr0l6NnEpx32l3EquUwbVFYmFq S9xqTKza+TbyBtD/5r4lrcsvOGODqOz7Idw1yIwNVpOCOwCNEa/dswQG/tgrbbU+1rVe aOMSHdF4Qk3zjJR92PPc+2o9wagP1Z73/z2mi82a0WuaPtOOfS4SO1UvsduH6P0bF6UY OFpj3Bqlf6umD4CtZ05ZqCKXXPC7Ih8MQhMwA8XeVvhC3obv7OA+yJAvA7TODvix72eE zZBw== X-Gm-Message-State: ALoCoQlPkwi2+i9cW2ifqXNcwm44GUxez1WhZLNK1T3ueUsg5PFfI+F1oZisNfzCbaRQ11SHM8Ha 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-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Aug 2014 18:20:40 -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/