From nobody Thu Sep 14 15:00:36 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 4RmgVY0KyBz4sZxc; Thu, 14 Sep 2023 15:00:37 +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 4RmgVX6pn1z4Wbm; Thu, 14 Sep 2023 15:00:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694703637; 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=hH3tGFqpQMOQ3GyvmMJwySzlOgYY2aTy4esKefrbWKs=; b=hbIrwDG6osFprJtVreWJXlpYGKs6f4HCGTDO7B8+sDoj8YWN7jBLz9TKwNrwq8vNY4gu4g TY7ekjscT6tgRBFIRGuYQCGgunlzeP9tYReii8bazUnmwmzUsmoF/k5kCrDMBT24tfb9RQ 9S2we4seP4HXr/SHdXRbiACzAL91DBPr2ljd1uZR48KMgtyl1g/63ylAd8Jc42qrhzbHO8 HwraaSV1+DsRKd8XGEOQhbMfhA64zWhGKHnNzwcCaTbZMj+gIKGn50J3egEam/E0tFfkLX EiWnJ9OAZ2GLYlxxfuZzaYd7iQEHXM/DLFwqSf3g2rM6yN8cmb/fuZpGDWnYGQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1694703637; a=rsa-sha256; cv=none; b=M7zKe5C90RB13kf3poMlxMjvSFz1L1nv4ZYqRxq4Y0+4malAyPV388ZVDxpXlfNXAqc/Uk fz4bibKTTdQVaW8f9Nq0Hboi2+SViQ7rMI0UDsLVYC66MjKES+wNFRMr6sXfvvmORYNxHg HnZPPyASgKl3TCYrudZ2lDlT8kGRjcEZdlu3AcSyoZzdoHsDNTuyQdU4PNXu0tigD8zi1k PYH5ZZthUJfeSU0ZGv4op8LZKOlbn6OHjIXWqRUokaZVFsvqmo/hYR6WFNMStp3kTJG0x5 0D+JTyy2Sh6sckOEunKfyjbvZUTb8TXzGSCtRU5VppVBR4Li+nfXV0eamSC6vQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694703637; 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=hH3tGFqpQMOQ3GyvmMJwySzlOgYY2aTy4esKefrbWKs=; b=VTSRgU5Pod+XbqJSCLXBahAOTlkhykfuCnqYhbVPoXyvIiFTU2zxmN9b7H32xAsGxx6kxk Fb3S43f1jt7gi9GkloWWrJzO+pcPmKLcdME1Xinhb1DvuaI1wTGdXNvCVv4X8gqTWjCXiK NieiD7f1VgSca6te9mdPU7/sw0F0XAc6gsi1Y2mv7sA8JeYLesORMRdV2SJ31g8GAZy88q zbmqwrscwE9Br0KCQIxpz7pApJe4cSy2tcEws1g2FMUIQmeyv2Ac5IWG/JQpH86SswLvTR j+b3LdNgVEcDY/cSbIhJrNd/qfDXhVKxk4I6Y0lL6Iyxvqfs4JzcohTQcHQklg== 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 4RmgVX5vgZz1207; Thu, 14 Sep 2023 15:00:36 +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 38EF0a4Z089710; Thu, 14 Sep 2023 15:00:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38EF0aKW089707; Thu, 14 Sep 2023 15:00:36 GMT (envelope-from git) Date: Thu, 14 Sep 2023 15:00:36 GMT Message-Id: <202309141500.38EF0aKW089707@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 03f654e953f3 - stable/13 - grep: Suppress EISDIR when reading. 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: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 03f654e953f3f1e1e0e7765318a05e36492bd163 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=03f654e953f3f1e1e0e7765318a05e36492bd163 commit 03f654e953f3f1e1e0e7765318a05e36492bd163 Author: Dag-Erling Smørgrav AuthorDate: 2023-09-08 18:17:41 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-09-14 14:59:52 +0000 grep: Suppress EISDIR when reading. MFC after: 1 week Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Reviewed by: kevans (cherry picked from commit caf5283fc92edb83173752b1dafbc6d586e78815) --- usr.bin/grep/file.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usr.bin/grep/file.c b/usr.bin/grep/file.c index 2845f0ec225d..804d75b82484 100644 --- a/usr.bin/grep/file.c +++ b/usr.bin/grep/file.c @@ -72,6 +72,8 @@ grep_refill(struct file *f) bufrem = 0; nr = read(f->fd, buffer, MAXBUFSIZ); + if (nr < 0 && errno == EISDIR) + nr = 0; if (nr < 0) return (-1);