From nobody Mon Dec 23 17:16:17 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 4YH4S13sZ3z5WyyR; Mon, 23 Dec 2024 17:16:17 +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 4YH4S13GMbz51v5; Mon, 23 Dec 2024 17:16:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734974177; 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=OFQcxqdQVvcZM3scWwTNtjXOPpXSJnes/z2ci71tL/8=; b=yXEshEkHGwS1DrcMkILUsyH/fXWw7xrUzENQHoqTDyKy1M1yw+E1kaat6Y6j0dAh77ecbt /VbLwl/TXUd3DfI3fJFP2sYc3VrtFB4zkfoISkFRFoDYvHfrGlDGAckfhG8xhV+zIuFyeI uh88Ml1XD0ph47jnWzLUaYFI/h/B+ixoFf0GlXcD1l2AS/UcNWH4TnXXLqc9biP2TM/Jz0 0TmEM3JIuTVogWL8x0rD6JtIKZLOjT6gWBS3VDusU0geLY3V7LcnYad8m1OiPZrYmUqip/ xR+XDt0APRjkFblgl4DdGXzT2dHEwpKOTR/dHPU7xUOEo8tZFp2YG2nR9LU1aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734974177; 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=OFQcxqdQVvcZM3scWwTNtjXOPpXSJnes/z2ci71tL/8=; b=a8w9a5s4BG7PEdlRcUv65TsYPukMB/7xGd4BgAA0K6ehuHWg72LuKSseJje0cW1CaM7xHu k7zPR60cGhekQgclZZ/kFkvZ06L7/4TBbyXoOjLZ85CldvhBilrYVFUE1+h31wqCQoiE6H s6PzpOTWlrlJC6haUOxwtnsrXqP8PgitLHetXvOcdo3ufFvGjBxZ847ccapcIDflHcjJE0 /1iIAaKk9k3jOHcHEfZHsC8n6XzBzNB1pkHUJbIVNSSMebhw6OB6ukyhqUi30oX69RtokE UqO8xpTbD5PdrnJ5Tg3pxC8lujjmxyUnrzVOee94ZmiSHBagOJCHzRg0a96CIg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734974177; a=rsa-sha256; cv=none; b=gsDeOSqAg07l9yWkitWvZ8U2inpb/5sOKfY/k1xx4gICXnP/bmGBod5Y5OnwplTXHMqVOV aqOPLWYGmyqRZffUgjKK9IHW09OGA2gLxD2s1JufA84GoZMD7jeA9Rol6dU1T+tJZV9o2L 4FvGKz8hYf7sl9kTvgUE0W7/B8ot+yCrZrmzTqS7hQejudoZD7LF9cvV8HOEMyc1hBNHac vHFX/k6vsNqpIk6TMqIlTMX6/tnX/mIifuV5OqppemmkLi2rR2cH4UTbwPgW/Tf7d63DZy 2wH54YyZaptcz1gh43nXM3aam5Te0B4SCXoXagOBsCSUEdLwKA/WauAAS79NgQ== 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 4YH4S12sNkz12qG; Mon, 23 Dec 2024 17:16:17 +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 4BNHGH9S079712; Mon, 23 Dec 2024 17:16:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BNHGHrr079709; Mon, 23 Dec 2024 17:16:17 GMT (envelope-from git) Date: Mon, 23 Dec 2024 17:16:17 GMT Message-Id: <202412231716.4BNHGHrr079709@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 893839b11988 - main - diff: Fix device case. 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: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 893839b119880d3fe8ab18aba4563af6c80cb875 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=893839b119880d3fe8ab18aba4563af6c80cb875 commit 893839b119880d3fe8ab18aba4563af6c80cb875 Author: Dag-Erling Smørgrav AuthorDate: 2024-12-23 17:15:57 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-12-23 17:16:14 +0000 diff: Fix device case. We already fell back to Stone for FIFOs, but we actually need to fall back to Stone for everything except regular files, because libdiff's atomizer needs to know the size of its input in advance, and neither FIFOs nor devices can be trusted to report their size. MFC after: 1 week Reported by: mav Reviewed by: mav, allanjude Differential Revision: https://reviews.freebsd.org/D48181 --- usr.bin/diff/diffreg_new.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/diff/diffreg_new.c b/usr.bin/diff/diffreg_new.c index af9104559986..f54cd554ccad 100644 --- a/usr.bin/diff/diffreg_new.c +++ b/usr.bin/diff/diffreg_new.c @@ -314,8 +314,8 @@ openfile(const char *path, char **p, struct stat *st) bool can_libdiff(int flags) { - /* We can't use fifos with libdiff yet */ - if (S_ISFIFO(stb1.st_mode) || S_ISFIFO(stb2.st_mode)) + /* libdiff's atomizer can only deal with files */ + if (!S_ISREG(stb1.st_mode) || !S_ISREG(stb2.st_mode)) return false; /* Is this one of the supported input/output modes for diffreg_new? */