From nobody Tue Feb 10 15:27:42 2026 X-Original-To: dev-commits-src-branches@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 4f9QRg1X9Fz6RVbZ for ; Tue, 10 Feb 2026 15:27:43 +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 "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4f9QRf44Ylz46RV for ; Tue, 10 Feb 2026 15:27:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1770737262; 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=QlXvD8wEcYksspzdJa9SdKHc66Lf5n6uKFDqN4/MAkU=; b=m7uNgUaK0IzijmSjm/4UXESznxZL5tjs1irSXqXjMr9GTkxLQMJiotjIWvl6rugirU9SVG YZqEEjpeQuDCEpF+GseUxo5Boa86WcUtFybSXyyLRNwrojy9LSVubEh89DLtLaa//GLrbr qUIsTgA/976Hnxvz/QH36LWpxn5aaJoI7XgFJ2MFdx4WdQFcpy0DCIBPm/NfCepOz/TjVa DSpPBHMks7ZzOUDxCfGcWNDHxYdlG1/c9mXDHMd9s8xge5z7THZ+qjJagmZPvaKHJLURnI fuuiqlohHlaASMn2YcniLg2LnaHczre42Pn8ows8Vz+Mh+MFrXlAWCM3N0HS9Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1770737262; a=rsa-sha256; cv=none; b=YxTip3/osxF1ttiKhw3tr0XpWAwBrew9+RogJMJGnpwf1l3d0JiXo23HFqOe7CslBsDJ1y SrGuhzfV1IueHYFCIUdda1LXeQ0TsYKOcqIo9CiVyUdtWLhhUEP9IGL0w22ZyXwciRJ3gW ZygHzgIIYJJHw0oKaGqREqyrmqLQK5/4B/jUzu42qAb+iaIByOLhRNKIQGtU7feP2Fo7sC hgrMRScn4Jy9uSUOM9oD8ZhZu6s3IxX6JdNKVEZtdP9Mf3hEZew4NbScTKZSxjvBkNUNbS B1Hj1gCJDnDzcuUcrHcVFijfAvDn2H31W04fMJokXi6tdHKmw0NLs7myKGtiEw== 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=1770737262; 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=QlXvD8wEcYksspzdJa9SdKHc66Lf5n6uKFDqN4/MAkU=; b=ce9+JIixrQKF4jYfLdCk0WcF8u5s/oSJMKGh+y0kmHXXGw3B4Tb46I2mvlpXS2gSTmFq7c nb8kHg8GAVlXrIj62XWmnP+TfmjkWdqIMbK/UQtae+Qyan8WFbqtaRtsR8YwRZkGausVe4 6evM+wxZaTjF6/psSJ1h0L20mqKmLaknI1z+AzVh0H9TG+fB9lFQDXYj6ZYIiRBWdbNQx7 R5YQwnSlZ31vIFgzAOCRrjX62UOKEBjC/KNaCbjoCy1uRJdCDTogPb25UcLWpysZ8yzyV2 9zvIyu3hjSls82plr2dLjKmpkepqNZ7iOh2ma6s9gG0hwJNk/5PeNeBPJklvMA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4f9QRf3d80z1MnD for ; Tue, 10 Feb 2026 15:27:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 44ea9 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 10 Feb 2026 15:27:42 +0000 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=B8rg?=rav Subject: git: cbd160023586 - stable/15 - diff: Report I/O errors in Stone algorithm List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/15 X-Git-Reftype: branch X-Git-Commit: cbd16002358677d06e8e43b23ed202da2b3c930c Auto-Submitted: auto-generated Date: Tue, 10 Feb 2026 15:27:42 +0000 Message-Id: <698b4e6e.44ea9.2f658028@gitrepo.freebsd.org> The branch stable/15 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=cbd16002358677d06e8e43b23ed202da2b3c930c commit cbd16002358677d06e8e43b23ed202da2b3c930c Author: Dag-Erling Smørgrav AuthorDate: 2026-02-05 17:41:56 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2026-02-10 14:24:09 +0000 diff: Report I/O errors in Stone algorithm In the legacy Stone algorithm, we do a first pass over the files to check if they're identical before we start diffing them. That code would correctly set the exit status if an I/O error was encountered, but would not emit an error message. Do so. PR: 292198 MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: thj Differential Revision: https://reviews.freebsd.org/D55125 (cherry picked from commit f8c12e6e3874cdd353fb16785da6f4e7eb134cd9) --- usr.bin/diff/diffreg.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c index 95c724817ede..8dcf55a7190b 100644 --- a/usr.bin/diff/diffreg.c +++ b/usr.bin/diff/diffreg.c @@ -406,6 +406,10 @@ diffreg_stone(char *file1, char *file2, int flags, int capsicum) break; default: /* error */ + if (ferror(f1)) + warn("%s", file1); + if (ferror(f2)) + warn("%s", file2); rval = D_ERROR; status |= 2; goto closem; @@ -499,9 +503,9 @@ files_differ(FILE *f1, FILE *f2, int flags) return (0); for (;;) { - i = fread(buf1, 1, sizeof(buf1), f1); - j = fread(buf2, 1, sizeof(buf2), f2); - if ((!i && ferror(f1)) || (!j && ferror(f2))) + if ((i = fread(buf1, 1, sizeof(buf1), f1)) == 0 && ferror(f1)) + return (-1); + if ((j = fread(buf2, 1, sizeof(buf2), f2)) == 0 && ferror(f2)) return (-1); if (i != j) return (1);