From owner-freebsd-bugs@freebsd.org Mon Jan 13 10:25:36 2020 Return-Path: Delivered-To: freebsd-bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8920C1FE783 for ; Mon, 13 Jan 2020 10:25:36 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 47x8qh39c2z4HyS for ; Mon, 13 Jan 2020 10:25:36 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 6B1741FE782; Mon, 13 Jan 2020 10:25:36 +0000 (UTC) Delivered-To: bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6ADDE1FE781 for ; Mon, 13 Jan 2020 10:25:36 +0000 (UTC) (envelope-from bugzilla-noreply@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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47x8qh2HrHz4HyR for ; Mon, 13 Jan 2020 10:25:36 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4A26B2FBE for ; Mon, 13 Jan 2020 10:25:36 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 00DAPamX073765 for ; Mon, 13 Jan 2020 10:25:36 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 00DAPaqV073729 for bugs@FreeBSD.org; Mon, 13 Jan 2020 10:25:36 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 242828] diff -rq still does full file comparison Date: Mon, 13 Jan 2020 10:25:35 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 12.1-RELEASE X-Bugzilla-Keywords: regression X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: fnoyanisi@yahoo.com X-Bugzilla-Status: In Progress X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: attachments.created Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jan 2020 10:25:36 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D242828 --- Comment #4 from fehmi noyan isi --- Created attachment 210686 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D210686&action= =3Dedit patch for the diff(1) -q In addition to the code I gave in my previous comment, the "status" variable needs to be updated in order to set the proper exit status. The attached patch seems to work and the patched diff(1) utility passes all= the tests. root@patch:/usr/src/usr.bin/diff # kyua test -k /usr/tests/Kyuafile usr.bin/diff=20 usr.bin/diff/diff_test:Bflag -> passed [0.071s] usr.bin/diff/diff_test:b230049 -> passed [0.020s] usr.bin/diff/diff_test:brief_format -> passed [0.075s] usr.bin/diff/diff_test:group_format -> passed [0.020s] usr.bin/diff/diff_test:header -> passed [0.026s] usr.bin/diff/diff_test:header_ns -> passed [0.023s] usr.bin/diff/diff_test:ifdef -> passed [0.022s] usr.bin/diff/diff_test:side_by_side -> expected_failure: --side-by-side n= ot currently implemented (bug # 219933): atf-check failed; see the output of t= he test for details [0.033s] usr.bin/diff/diff_test:simple -> passed [0.086s] usr.bin/diff/diff_test:unified -> passed [0.038s] usr.bin/diff/netbsd_diff_test:mallocv -> passed [0.024s] usr.bin/diff/netbsd_diff_test:nomallocv -> passed [0.023s] usr.bin/diff/netbsd_diff_test:same -> passed [0.024s] Results file id is usr_tests.20200113-172221-636074 Results saved to /root/.kyua/store/results.usr_tests.20200113-172221-636074= .db 13/13 passed (0 failed) root@patch:/usr/src/usr.bin/diff #=20 The patch file was generated with the command below root@patch:~ # diff -u diffreg.c.orig diffreg.c > diffreg.c.patch root@patch:~ # cat diffreg.c.patch=20 --- diffreg.c.orig 2020-01-14 03:16:23.048362000 +1300 +++ diffreg.c 2020-01-14 05:49:28.212503000 +1300 @@ -342,6 +342,12 @@ case 0: goto closem; case 1: + /* if brief output is needed, just return to the caller */ + if (diff_format =3D=3D D_BRIEF) { + status |=3D 1; + rval =3D D_DIFFER; + goto closem; + } break; default: /* error */ root@patch:~ # uname -a FreeBSD patch 13.0-CURRENT FreeBSD 13.0-CURRENT #0 r356528: Thu Jan 9 04:5= 6:46 UTC 2020=20=20=20=20 root@releng1.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64 It would be nice to do some performance benchmarks given unexpectedly long running time was the driver for the bug report. --=20 You are receiving this mail because: You are the assignee for the bug.=