From nobody Fri Nov 11 18:11:38 2022 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 4N86Gf3qxRz4dWY4; Fri, 11 Nov 2022 18:11:38 +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 4N86Gf3MSGz3mvT; Fri, 11 Nov 2022 18:11:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668190298; 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=b4aW8z1l33q2xLmfuKTppcCClDayVsH8JJYBtlyVmFk=; b=H706c7zd7jdYeZkHYM2nhiI5y7Pi4Vmmug4bBttXUyTufGardnxCP0Oi22sxrlU38fHwVg qjGJqrUGjvMdopp7azwOnKfQZsp43YdEerYiecohR6HKQ8u/am1/GNPx4Klj6YWtqS6rSY 5YD3LO5XvCTAocQhdsdAE6/fB6G7cSbOAejIBtLlH8wWEbWdxwScLovDVGeccZXy9eMjuA mlggGsRNDDKyQIWkipot63RhDvWVhWrfp8EZ0vZSIRveVGiFrN8fk0HuptvhcXVTMPqg4z 5Aj3ed7WUWOTfvo9rhz5p12Xa7kiJkiYi15CllHVHvo3Ha5OvhjaS10KFDy23A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668190298; 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=b4aW8z1l33q2xLmfuKTppcCClDayVsH8JJYBtlyVmFk=; b=qt2WJyjXRljD2nZ+ndlsFiYJ02qDfVAQGuv8oJGcxKgFXk1LvPePSaIFCmVwThcBWlSyzu cSuJP9dg405QXXmpPevscNNkJyziISn+vZ9cgBjONOIzL2DpABo8v6tx9MBt2WFN4YA0CW WWZTnHen46zsnev2cH/BSSPkUZdutrejS604AeZs801L0tKYGFoKqfw4smRHzP6i2bn7Sv 334UtnfVO/8sDO9sa1jkDGYNYuTHUMYb0DcvEkZ4RrLcUA4s/Xk/ovOSuoGBo+ugXlYwfo wOtK7AOoZm4YxqwpvNWPc0qG1TiP7FHjU7aWRFZ4Lq9WNxxVWlaiZcHvgLYEnQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1668190298; a=rsa-sha256; cv=none; b=UsnZ00TPVpY2G1ec1RpVI13yn67RU80PkVKrxhHst6VMotwFylHrA6mwXhhdUMOdLf71Oi Fjm4gcDguivFBQYMqf2TnVxmFLZ8AKnQi8aCnK+ZrAWkBzvfionX/nZAzZhu01gLlCuE3+ dW1rMEh2sEADvwhfkmbPSwPulWOhm5mf7VmA3Ik1y2i64CGpXmtIC3IAqzr8oI3IaIp/aS OjIn0YOTTGlt+fE4Rr8ktYJNZozzxqPSEZTLo0PghskezX1CnkbxvPnN3DKRid66DkhFOe 44dkGPu9d6fX3sWiid6uOxe80oYhTwi/yVP+w4VGxvoNA37R0fojO8QkJicBFQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4N86Gf2TQWzsMp; Fri, 11 Nov 2022 18:11:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2ABIBcFh073089; Fri, 11 Nov 2022 18:11:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2ABIBcPC073088; Fri, 11 Nov 2022 18:11:38 GMT (envelope-from git) Date: Fri, 11 Nov 2022 18:11:38 GMT Message-Id: <202211111811.2ABIBcPC073088@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 1a7136cf2942 - stable/13 - split: reset errno prior to getline() 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: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1a7136cf2942ba895e3e7ce9d524afca1b1c8e08 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=1a7136cf2942ba895e3e7ce9d524afca1b1c8e08 commit 1a7136cf2942ba895e3e7ce9d524afca1b1c8e08 Author: Math Ieu AuthorDate: 2022-10-27 17:01:57 +0000 Commit: Kyle Evans CommitDate: 2022-11-11 18:08:57 +0000 split: reset errno prior to getline() Something else may have set errno, breaking the post-getline() logic that tries to detect the getline() error. This was initially noted in a jail on a system that has HPET, in a jail that does not expose /dev/hpet0 -- we see an earlier error in libc's vdso bits. Fixes: 5c053aa3c5e90 ("split: switch to getline() [...]") (cherry picked from commit 172be8642d93851b0c083d0db240cf35fd56ab0e) --- usr.bin/split/split.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/split/split.c b/usr.bin/split/split.c index 008b614f4946..091c914ba8f7 100644 --- a/usr.bin/split/split.c +++ b/usr.bin/split/split.c @@ -278,7 +278,7 @@ split2(void) err(EX_NOINPUT, "fdopen"); /* Process input one line at a time */ - while ((len = getline(&buf, &bufsize, infp)) > 0) { + while ((errno = 0, len = getline(&buf, &bufsize, infp)) > 0) { /* Check if we need to start a new file */ if (pflag) { regmatch_t pmatch;