From nobody Thu Oct 27 17:19:13 2022 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 4Mysq60sjLz4gYPq; Thu, 27 Oct 2022 17:19:14 +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 4Mysq60M9Bz3x1q; Thu, 27 Oct 2022 17:19:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666891154; 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=f9di887pyJbblsnOplJYYv1ohwj7p4w6o2kQDoiRsbY=; b=bz1aRCVUcsJaAmFBPSyA0d+NPt+v+L4ZdiUFlSkeoTIKO+SWPx7zeJw+P/PuOv2CIOeV7e CUh0Tx5YnNaNU6hCIZ53md5BMnKiGO7m7+Gzkvcm2LsFeY/A/DolzstgB5ofp3vHpv6GHx fQMMBadm0CRCiduRQZVujKFRKx2oyrbHNLIDzbeane5OWGvCcMzcHBY2ClaOXrE2mEwBcC Y8qgx0PsscQbzxQ7TAThPP7fqiW8uVRKKlF30K7nVc8Ea31RgX9sum38bXT+0i8PPWnzzH S4dU79OgmRLAQTkLibXNaXv2WpfPJAYviJYqvTfo2gY7oKZ11T+VXdXEF+tTHg== 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 4Mysq56VZ0z15GQ; Thu, 27 Oct 2022 17:19:13 +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 29RHJDbb062752; Thu, 27 Oct 2022 17:19:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 29RHJDNG062751; Thu, 27 Oct 2022 17:19:13 GMT (envelope-from git) Date: Thu, 27 Oct 2022 17:19:13 GMT Message-Id: <202210271719.29RHJDNG062751@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 172be8642d93 - main - split: reset errno prior to getline() 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 172be8642d93851b0c083d0db240cf35fd56ab0e Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666891154; 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=f9di887pyJbblsnOplJYYv1ohwj7p4w6o2kQDoiRsbY=; b=kBZUfZ0w++N6xuG33JXzuLRvpNmsGbZiBUgmNXnjHg2P/xupwo39ZS9hmNbmnIEhs7pWIT UUdqgGIJ2pimQI4La0YPUFf7GixutI7os2ZPCm4EGlIFh3dQ5pZr+BgfJ6FQxqnnVObX7t uopsxwqzfvokRTmDQ0DOfK99INjtk7mJ6UXh/bFVzODN0Cqg0CHt6UYGh7Fttb46oWptcy 8Fv2wB5rk8tYwoO6jDCgVg5gZuxg1lPHvOZD5TLEweUs4TiJS1EbZyv9oQA2rhqGSMtMP7 Gzon/zydtnoa6Bn2dmFkvb4S5mdygK6XWTpWR2qK8ATtpJwFLBepdy88POjv9A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1666891154; a=rsa-sha256; cv=none; b=c6IoI3vkb9wF+p8yploiTox+1ysAXticGiuT5RIwI+WadD0eLgkJ00CVFj2aAHpirWxb0N LJmwopvLDQg6/Sou6TmSKRfaQ+3DYxrNYzGBn/uBRulFThkJYI7bC+kKUbs4BJKBkANGeu 4PSZ0LFjVpg0Uhz2VA4Pgopy7zoCr0WIYb1j5Di9hTQhr7yRwkKYQn0HVr1xysMz9xdbqt cN4SMBPlo1Pn56Rj87YvO1s1EFkPrRKd7XSGRD/hDMJMY8CB0m8db6nwM/i0xCxNf2CE/d d9WTO1LimmroTtdOdHoDraNUf3p3p83TAlhxtUSLNYp04sDOiaw0GBV2Z6RuXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=172be8642d93851b0c083d0db240cf35fd56ab0e commit 172be8642d93851b0c083d0db240cf35fd56ab0e Author: Math Ieu AuthorDate: 2022-10-27 17:01:57 +0000 Commit: Kyle Evans CommitDate: 2022-10-27 17:17:59 +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() [...]") --- 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;