From nobody Tue Oct 08 18:40:45 2024 X-Original-To: dev-commits-src-main@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 4XNPwb21Dpz5XlWW; Tue, 08 Oct 2024 18:40:47 +0000 (UTC) (envelope-from des@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XNPwb1ZL2z4GGd; Tue, 8 Oct 2024 18:40:47 +0000 (UTC) (envelope-from des@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728412847; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+qE2o+dyDSd/3zgGGWaev/y5GzIWA61b2EkCxIgKq7Y=; b=buhi9lPVJeR0wGTfYGa/qIP4rGrR6zm8+X/WEaMo5xsh8RNHLVkzbRB+zZn+sArao6eeju pT2+Trdy+zU9/xqqsGstqLwG3/kzWrRYCGR4WBQIlzig8ROxD/5K87QKmNjUF+1stlHI+K 5KwFStyA3H9mkYRCB0FUCnmn12eVuRz5zsvjDKfrIfp1IsdrDaNB9v4kWcTZXM21lpuHC1 6yd1XHmQQn5g1DyCupGIRDfdyxl7pOF2mU8vBIDCMWc00WwLJiNgIqzANaVD1XM9X+9ESF e5+quEAUP2KcOqqk/hkO/+kxWfVbC1lLMWBkAmcC7E7PqJQRkRbH1l8c/tuGdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728412847; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+qE2o+dyDSd/3zgGGWaev/y5GzIWA61b2EkCxIgKq7Y=; b=T34B/YUBEA/P/JWNEeZgJVZ0Mx24/cv8kCOiOigiLtlV2Qm7gFn+bHTG2kiSQsqeIs0HxM B4LERPXlz2nurCybEYq69tuwUbMB0vXRbDQHJjmX+20a0kYMZZxTzOuvtqxfqgbcSwUJUj IWciZ36uUovRA5esQDZzAAUMHWmPz8srGoO/PT3GJfahT4xBtaaMWFDBRBZEv/iu0s4xDN ZryL/7jjfRLQdFysEhokOsl78sBVV4Pbe5m9zi569vsSuGmKVFV9FH3m/MuV076dPf0N4Z MD/TRYBJ6R5ewkh9JLkNzoL0BU5exzEwE2MB/n3wD5/gRqalB6b1nzzK0zaPBg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728412847; a=rsa-sha256; cv=none; b=dIGV6n1drMup8/owB+pR87ft1CKdmIAbdlSOeZeHAnt/bEta7GjsgD3O2GPu53p89FN5zf ukrd0VqPEr46dqz45qoIAK/oB4jXdgEc8akzWs59+mU3wlgMzAiTuy1ioIvNJukA8mDs0/ hi/eH6a0oBaqIz1WodbAzV2dGEq2zSH75zVTt8jmHduz9HyDzAyMqfa0sQobhBRgzXC6Zs AOIsHS/HeSqpgnEYOj1lPE4ZJoMKTi4bl/FllQ2S3siw8xm3bF7A62bWagHi42BHStEAj8 KACiMO8sp9oF72iop9ZUiDTip1pjQEmztVexnED4arGZnpFGRvqhtYqlSONwcA== Received: from ltc.des.dev (unknown [IPv6:2a01:e0a:386:9c20:922e:16ff:fef1:acef]) (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) (Authenticated sender: des) by smtp.freebsd.org (Postfix) with ESMTPSA id 4XNPwb0c1jzVdv; Tue, 8 Oct 2024 18:40:47 +0000 (UTC) (envelope-from des@freebsd.org) Received: by ltc.des.dev (Postfix, from userid 1001) id B74CCBF440; Tue, 08 Oct 2024 20:40:45 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: c2d93a803ace - main - env: Check the status of stdout. In-Reply-To: (Konstantin Belousov's message of "Tue, 8 Oct 2024 20:41:20 +0300") References: <202410081702.498H2KIP072012@gitrepo.freebsd.org> User-Agent: Gnus/5.13 (Gnus v5.13) Date: Tue, 08 Oct 2024 20:40:45 +0200 Message-ID: <86iku2v3o2.fsf@ltc.des.dev> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Konstantin Belousov writes: > Dag-Erling Sm=C3=B8rgrav writes: > > + if (fflush(stdout) !=3D 0) > > + err(1, "stdout"); > Why is this check needed? POSIX requires it. > Or, put it differently, why is it needed for env(1) but not any other > program that writes to stdout? You mean like these? % git -P grep -l 'err\(1, "stdout"\)' bin/cat/cat.c bin/date/date.c sbin/md5/md5.c usr.bin/asa/asa.c usr.bin/comm/comm.c usr.bin/ctags/ctags.c usr.bin/du/du.c usr.bin/env/env.c usr.bin/head/head.c usr.bin/join/join.c usr.bin/lastcomm/lastcomm.c usr.bin/locate/code/locate.code.c usr.bin/ncal/ncal.c usr.bin/sed/main.c usr.bin/tail/misc.c usr.bin/tsort/tsort.c usr.bin/w/w.c usr.bin/yes/yes.c or these? https://reviews.freebsd.org/D41390 https://reviews.freebsd.org/D41408 https://reviews.freebsd.org/D41413 https://reviews.freebsd.org/D41414 https://reviews.freebsd.org/D41417 https://reviews.freebsd.org/D41418 https://reviews.freebsd.org/D41422 https://reviews.freebsd.org/D41423 https://reviews.freebsd.org/D41424 https://reviews.freebsd.org/D41427 https://reviews.freebsd.org/D41428 https://reviews.freebsd.org/D41432 DES --=20 Dag-Erling Sm=C3=B8rgrav - des@FreeBSD.org