From nobody Wed Jan 17 15:56:12 2024 X-Original-To: dev-commits-src-all@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 4TFVq11LJvz585YB; Wed, 17 Jan 2024 15:56:13 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TFVq10nLgz4DBY; Wed, 17 Jan 2024 15:56:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705506973; 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=5N8LYEetOo6VNbe7DR4m6UHVeWtdmH9qGBYLNpH+v8Q=; b=wI0HKggwuJiqGnlrxYAGgdZkC3fo0qm/pPzzxK2IRGt3fRAXrEYLAOhNobfc3oNIvdL4RO LxJxZAoh0GId9mCtBIf+94ohgP55dqdgFCBSSutdITAtIh/W6Clby057kznqWxvJZha3Vr KTxn9KuT2MgMr1+LTOabX99+nS4XeNEPi4gdUzqd4VE4MuF3i79GVe3+eF6o/BzYxCVVLv HTQdhkkadm2aId29h8Nt3utwTlXMgq1qt1fYoBU65Iu2SuUbVdrKAS4SaZyAKX4Yw5f7xD aQSlvc8cqbjUAyhYuwh1woPFmhCwTxc8jAlAy5DbqYhgtWCz3ZGKrwMmf2L7Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705506973; 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=5N8LYEetOo6VNbe7DR4m6UHVeWtdmH9qGBYLNpH+v8Q=; b=sfIMuju3c4SqsILM4r6r7z3yeRKqSkCpqQMd5Lue2OxC3h0a5GqAUFoVI+G0IWLwWL6lrh 10Cd8ZZCL+9UP+/AHGtrY8EL3JOOOyf5LyL9aqHTi5Ao87H9ep+yGl+BzkYuNfJSv5c9tU 0wPA8lWlj1/HvbpmyRVCb2OZODne0sZO9ECcXKuGm4TN/UkdJa87MzvCfkjuAHYp7MJWxW mpOn9HevlIOA0Hlq4/LmENlcmhgQR5Cl21A53p2ZZiWxPe4nXePSAmfCEr9QFrj+9/R+Cj iTc7ezdhnRwresPkUQj8Dg/VWgzt2FVUEhu1zzxMJw8uP9entUCzQaGbLUZUDw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705506973; a=rsa-sha256; cv=none; b=YwoW/tblVLnQ51pEq7+E/BWr5tTp8toPB7SzDGfpFjcVHDbIdA7rDc2SnK48M/oJrGaiBO mzwv9G90ZBMpG4AKfWbP+izsfMy7LV8v0L5BCqVjv3YxLwY3o6naQyMyduQPTmum/MJT/t azZRP0cmPVcxV5m167PeESDYE6KXmu1KLpsAtWrai+sXw/b6ZCeCOJ9ZvqqHoc/1ftOd2D Slda5AsH52dRgvhaQXPJTZN9viSfirxq/9oyfpI9joN41lImLQBWW5Kb7UDjPiEjTOTHPQ l871R2s7p2GsFOdVWLRMn1fq0KLxDaNBU7+pDM8ob5VzO+0u9dlkH91hF9Qlog== 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 4TFVq06yPJzVHj; Wed, 17 Jan 2024 15:56:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40HFuCbl009768; Wed, 17 Jan 2024 15:56:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40HFuCIQ009765; Wed, 17 Jan 2024 15:56:12 GMT (envelope-from git) Date: Wed, 17 Jan 2024 15:56:12 GMT Message-Id: <202401171556.40HFuCIQ009765@gitrepo.freebsd.org> 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=B8rgrav?= Subject: git: ab215565c81a - stable/13 - Fix test output when gzip is run with -tlv List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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: ab215565c81a0dc1f97635cc0647084ad1480ba3 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=ab215565c81a0dc1f97635cc0647084ad1480ba3 commit ab215565c81a0dc1f97635cc0647084ad1480ba3 Author: Tom Jones AuthorDate: 2022-01-27 17:17:13 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-01-17 15:52:02 +0000 Fix test output when gzip is run with -tlv When run with test, verbose and list we need to parse the file otherwise the test output is "NOT OK" even for the file is valid. Reviewed by: kevans, allanjude, imp Sponsored by: Klara Inc. Differential Revision: https://reviews.freebsd.org/D34046 (cherry picked from commit 21c966a6b9f2e9110b8dc2a822ad2b4583f4f18b) --- usr.bin/gzip/gzip.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/usr.bin/gzip/gzip.c b/usr.bin/gzip/gzip.c index 95525f99b881..a21039aeb59c 100644 --- a/usr.bin/gzip/gzip.c +++ b/usr.bin/gzip/gzip.c @@ -1654,10 +1654,13 @@ file_uncompress(char *file, char *outfile, size_t outsize) case FT_XZ: if (lflag) { size = unxz_len(fd); - print_list_out(in_size, size, file); - return -1; - } - size = unxz(fd, zfd, NULL, 0, NULL); + if (!tflag) { + print_list_out(in_size, size, file); + close(fd); + return -1; + } + } else + size = unxz(fd, zfd, NULL, 0, NULL); break; #endif @@ -1682,8 +1685,10 @@ file_uncompress(char *file, char *outfile, size_t outsize) default: if (lflag) { print_list(fd, in_size, outfile, isb.st_mtime); - close(fd); - return -1; /* XXX */ + if (!tflag) { + close(fd); + return -1; /* XXX */ + } } size = gz_uncompress(fd, zfd, NULL, 0, NULL, file);