From nobody Mon Nov 06 14:45:17 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SPDfP401vz4yrbq; Mon, 6 Nov 2023 14:45:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SPDfP3S18z3MhL; Mon, 6 Nov 2023 14:45:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1699281917; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zNu1eEb6i85voRuXWx7FH4lTpT7jkwa43/Fl9+jL4WE=; b=xDHyPrE1xH8Dgj0wn3AyghuPA32Tp2oCO/KLzPwKvuXBsudwxa1omQ3JXt4W4rSFm9o/Rr q6JKtUlQRa+Xvl6xCoe5998hCkoxXeaxGoXacK+cYu9MIFT63TWzhf3rE5SoNKVf7ArJf7 HLDhTa2medz8xglLaJsw/u5joJz3M5aKXKkQhOqlCCSAhVsKydqBfmHtw7PjB5MeFcqBXy PTOWCKeL5A1rClyS6rTitlfReQJbmCpSv+0TBBsRjjrwXEaTsRDDVMcln859Jxib+DZ27w ygLErYNofwulLxBGMRL1fqWi6ZER+7lvXNR9tZZazuxmD79v4EIwZUYePB3vNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1699281917; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zNu1eEb6i85voRuXWx7FH4lTpT7jkwa43/Fl9+jL4WE=; b=gCvfmvqZ5BDyLc/N09N4MzheJDvGdjtpgzGMex6sz0i52rmM7wymf7WZZjr6tnhvALzGKT uiWbyClgkXL4znCFegacVTnDNYFPoHMjNr3KPRYQMZtscU7VqLkW72t+1VKK9YvEjUtyL8 tNiL34abplrEooFnRExd2LEfJzjsLuB4b/LTQtj4HTF3IgjlYCe36i4RxcgNLyqkX0hB7j ND0ZfC4PzpWklJEjIYn7ii1PKveNQUBFrV7/JVPtjBS0NLfRBiANdwjpf9GgQGLm47lTji 4YTOGYJq2N5E2KVrjCsyODWZeGXGsgwLOo0ChkuBmPjseNGdJqNcEx6tCx1LeQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1699281917; a=rsa-sha256; cv=none; b=o1+S82wXhpI5Vc7nKuQTyzBbdidIy+MAJyguBFYShD2dOpJ4an1i7TupnDzGWF8PY+6YEl bqRUoL8Qpu37KHrnB1KZaTkZvSgm9/SPhyzMkixsCKFmWJwa/r6LmGKv1Hltgug3IoS8Lm ++IJcrtpn8uWV+u8TXrC40fweZiBQaiwlewr8N4pxcNQdANNRrm15vKrws6bHaiFrW1UDA 95JRXiGabvtQ8pkmWki94umncW98Hi/KQ/3JPbDKnuCYpM0WmtA/E5lqNe4OLW1pL6UEOg CJXlKyTI8HMSh57aOXfXH0JSi4Zm/4KpNKahxvCtD483e+HkXQi0VFNEy/g8MA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SPDfP2Xfpz19xy; Mon, 6 Nov 2023 14:45:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3A6EjH3M057778; Mon, 6 Nov 2023 14:45:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3A6EjHrq057775; Mon, 6 Nov 2023 14:45:17 GMT (envelope-from git) Date: Mon, 6 Nov 2023 14:45:17 GMT Message-Id: <202311061445.3A6EjHrq057775@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 95fbce59c9f4 - stable/12 - fflush: Split a temporary variable in two. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 95fbce59c9f4ed4015b19a88491a37dac9d4e7d5 Auto-Submitted: auto-generated The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=95fbce59c9f4ed4015b19a88491a37dac9d4e7d5 commit 95fbce59c9f4ed4015b19a88491a37dac9d4e7d5 Author: Dag-Erling Smørgrav AuthorDate: 2023-08-03 15:08:03 +0000 Commit: Ed Maste CommitDate: 2023-11-06 14:43:45 +0000 fflush: Split a temporary variable in two. It is clearer to avoid reusing temporary variables for different purposes. Sponsored by: Klara, Inc. (cherry picked from commit 1f90b4edffe815aebb35e74b79e10593b31f6b75) (cherry picked from commit 1e99535be2ea9c0ef8bc57fc885e9c01fa95d2dd) (cherry picked from commit ccdd8337f9cbd7d34e2e95df1440dd5f7225d0b4) --- lib/libc/stdio/fflush.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/libc/stdio/fflush.c b/lib/libc/stdio/fflush.c index f7d2fbdc28e5..05e587ecec66 100644 --- a/lib/libc/stdio/fflush.c +++ b/lib/libc/stdio/fflush.c @@ -106,10 +106,10 @@ int __sflush(FILE *fp) { unsigned char *p; - int n, t; + int n, f, t; - t = fp->_flags; - if ((t & __SWR) == 0) + f = fp->_flags; + if ((f & __SWR) == 0) return (0); if ((p = fp->_bf._base) == NULL) @@ -122,7 +122,7 @@ __sflush(FILE *fp) * exchange buffering (via setvbuf) in user write function. */ fp->_p = p; - fp->_w = t & (__SLBF|__SNBF) ? 0 : fp->_bf._size; + fp->_w = f & (__SLBF|__SNBF) ? 0 : fp->_bf._size; for (; n > 0; n -= t, p += t) { t = _swrite(fp, (char *)p, n);