From nobody Sat Dec 14 04:33:14 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 4Y9Cxk6NHNz5gg6F; Sat, 14 Dec 2024 04:33: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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Y9Cxk448Nz40WK; Sat, 14 Dec 2024 04:33:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734150794; 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=jGP1t/EK0WGRN2SoAjFXfg48fcrQp+vv+e6yWjpx3Qc=; b=N3EzQNgqD+dkvy+LIEi7cL/h/YRfMvRA2gRRXZE54Zxl7Ip2BDuJN+phfeueT/qjmmzMs9 p3nNAZVmJO7zihdcaiOPEiEWcJ9TT9GBnLu/ChnhSfznZQ+bzInTKEJsNiq2rSA4I86V4U O5W5IW1FbiNsONsaitGJ1StZKOs3qpYDPI6ln/dNumPek4Srjzh9LyVBF/x+z89rtFizok iHCnUvqMnH1ljkfk7ee6fgzEzUB0H8xzSivUF9sVUVKGu7lesODt+xierVzJlCpt3c/ZfS 78ppUN/M55+0YFYqfJE0WJ59Dm68/aWpAo1O6C8WchJ2hM9JYuXkvHZlg/fBPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734150794; 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=jGP1t/EK0WGRN2SoAjFXfg48fcrQp+vv+e6yWjpx3Qc=; b=Pot8B3cygUk6atUNgpC8y8oh7JKXSeq0meXRaH+OFSWNJzAXYZRFotyP/ZHgfBWDTecBT6 pil94NuIfrdk3YhrDO2V1mUrp6OZxAyZJitjDT+B8X6HQFv/HYVX/07ATaCSNkVjUqXQsw DQLrotN/K9jBgfaIFdJqD6MqPLPlx0XTUbWZVB4Z8NalJSXoua2t4tZSZ7LOCocUewxFyc FKV1ALR2iuUdfhO7ZFe7U5ZEWmhbvwdePFLwc2xfH4/zhAiTPzItSVNbbjhOo4Cq4B57NJ 084GYr8y4dPy9eGwudN0p5cH0/sXfkrA2P61R7ub4ImiwHvKxN7y4BM9PwANlA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734150794; a=rsa-sha256; cv=none; b=b1j2q6rYEfDqMgNqv8VeKI5pcuDrk0CmOMU573Y3dZodWVdAehhybj1hIH2GBT9s4n4cSQ V7AL0XjNqNO9NHRfs4uYFes46PUOiRFUeewa+PqpJSZeHpxnAFjyeQctKyYlI5rVVCr449 7RDsUxQlZjZle/coJ+Q4ZbZyRYkHJy7xfevgjn4c5CSBjhBQFA0nikjNe1awqHJ1+yMPTC okBaknY6tCM+9BL04+TGUB7VKpo6LtrcpYnQyvmtDT1+hLBjdP6Pln87wFCUWWUGm7HT5A QN2ru7+9BLMDe4k0zPowbJtZSuT6sL5PnquqgCxtjUVq8G/7jiZU+AUUj+i8kw== 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 4Y9Cxk3hPpz17HJ; Sat, 14 Dec 2024 04:33:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BE4XEbI048578; Sat, 14 Dec 2024 04:33:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BE4XEGS048575; Sat, 14 Dec 2024 04:33:14 GMT (envelope-from git) Date: Sat, 14 Dec 2024 04:33:14 GMT Message-Id: <202412140433.4BE4XEGS048575@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: 86b4df97d0fc - main - cat: report copy_file_range() errors with the read filename 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: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 86b4df97d0fc6980242e6d047390047c8c7be7dc Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=86b4df97d0fc6980242e6d047390047c8c7be7dc commit 86b4df97d0fc6980242e6d047390047c8c7be7dc Author: Kyle Evans AuthorDate: 2024-12-14 04:32:54 +0000 Commit: Kyle Evans CommitDate: 2024-12-14 04:32:54 +0000 cat: report copy_file_range() errors with the read filename The error may be due to an error while writing, but it's more helpful to report what we were trying to from rather than "stdout" for these errors. Noticed because of what happens now when `cat` gets an EISDIR for reading from a dirfd: kevans@ifrit:~$ cat /etc cat: stdout: Is a directory which, after this change, becomes: kevans@aarch64-dev:~$ cat /etc cat: /etc: Is a directory Reviewed by: allanjude, des, mm Differential Revision: https://reviews.freebsd.org/D41784 --- bin/cat/cat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cat/cat.c b/bin/cat/cat.c index 3e7974e5f334..c4c04fb3fff6 100644 --- a/bin/cat/cat.c +++ b/bin/cat/cat.c @@ -271,7 +271,7 @@ scanfiles(char *argv[], int cooked __unused) errno == EISDIR) raw_cat(fd); else - err(1, "stdout"); + err(1, "%s", filename); } #else raw_cat(fd);