From nobody Tue Feb 10 15:28:15 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 4f9QSJ4LDdz6RVcS for ; Tue, 10 Feb 2026 15:28:16 +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 4f9QSJ1XBYz47H4 for ; Tue, 10 Feb 2026 15:28:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1770737296; 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=0IMjneTIokmrpvY8GgkVanZfPSsjkKhik64tq/QTonM=; b=w+oKucrNfUTA/wBgBDJmgtEHOo/GU2FQfsrUd5KyZz8wj4OESarSLarHc/wZkZ3W4Kri4l KU0YgGsu0RbEa6x7WQL46QINliGJAw/Ac6AH8nlVyV2cPn2tRJs/mt7q0kb7E5PCGZLolx cOjDjOK5tZeYoPlmyPIlxcHVQDbBBxF1CNyOuPWdWQwhLuuFvH9yawle9iCgiXO+rj82PT nmASUjljRVzqYktJ5FEVL2xD/Bj2saP5CJkiFdDwVrKISqjPhvz7QAeQJHpLjfctMB+Lbb XhFMQtrd7JHb2maqa8I6cIYBc5eUdBDyR66UgDyv7Bi0pJX7yBHRVdpPqX8peA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1770737296; a=rsa-sha256; cv=none; b=RPkEdorxMlv6qCEYvTqZ6Kl81XuIwMyQkV22P56+IsV9jSp4P073z2/6zPlA7Car0dyMIL 25Ogz/MlVjgBlk/nPFXYOb+Ez67w79AQN/pQNi6qo972pmjCHfHw7LuMbGWlppok+pc5EL 3+pE84B4QzcR0plWxK2KwhBWxyx4v4D9lNTPvA8ooCoWWZQYxpo+QHuBzZh7E+YDhEIhNV ok1Z/fq8KTUN/zhl014kKRZL/71E/ufBHMVpIUxdmXFsEV+wlyDm6G7c/zFzKKNEEF2qKt F9jE0qQ9CXoYk1qDVP7GPzhCmPqUXA43aljnZ+EzB3q0XcXicjwuD1Rosy1jWQ== 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=1770737296; 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=0IMjneTIokmrpvY8GgkVanZfPSsjkKhik64tq/QTonM=; b=tSWi8AjSG0y97hruceBXNl1JY5EpfNhT4kNZw5cgZGIEIlF2Bm84LNPuAp25nSJpqvu7KN O51rvsUMMNneOVwxLUZCR+yJkZzHA73wjpDK1oVYZ4OEDSVFyUJYEt+CnR21opowOHfY43 2L24lbzY8+h/VJv9Vz6EYBnZy4Vqklld3HWxhaqJ85Jxiw2axjff6ypws6THVLq7M0nXc6 4cZTf91382u2kess/IfW3JT0GUPx967zciRUElDWTThXC4V7i3p/OOwyCFGntlcy5W3huP 97TO/o2KaseIeOEUsq37yRkABOmNG8Iu333WNT+WqTwS/YaHCwQ8i8BGdnFmlg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4f9QSJ0rtrz1MXl for ; Tue, 10 Feb 2026 15:28:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 451e0 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 10 Feb 2026 15:28:15 +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: 641366df41d8 - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: 641366df41d8e2a3bde877b712a08de8a49a76ee Auto-Submitted: auto-generated Date: Tue, 10 Feb 2026 15:28:15 +0000 Message-Id: <698b4e8f.451e0.721764e3@gitrepo.freebsd.org> The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=641366df41d8e2a3bde877b712a08de8a49a76ee commit 641366df41d8e2a3bde877b712a08de8a49a76ee Author: Dag-Erling Smørgrav AuthorDate: 2026-02-05 17:41:56 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2026-02-10 14:24:30 +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 ea7732bb6d99..78f3569a0ecc 100644 --- a/usr.bin/diff/diffreg.c +++ b/usr.bin/diff/diffreg.c @@ -369,6 +369,10 @@ diffreg(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; @@ -458,9 +462,9 @@ files_differ(FILE *f1, FILE *f2, int flags) (stb1.st_mode & S_IFMT) != (stb2.st_mode & S_IFMT)) return (1); 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);