From nobody Thu Jan 27 17:20:59 2022 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 41E3019732E7; Thu, 27 Jan 2022 17:21:00 +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 4Jl6n81DD5z4jRd; Thu, 27 Jan 2022 17:21:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643304060; 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=M4u2430Z1oSQRrFq1/NcQRQn7Ju+SROUxRALn38yhyk=; b=CCXJRLo2siUWsC6pu/QEi2gd7SkX0TvlGTZEx4gRWnjz88wUvCV6s4YTCyzabdUhfk6xnB t4ySOmi7JA5gCHX47BWq3q7spJXnWm0+vpA/eQ+BYw71Op00xVTUaSEA7W8Ans7bhRI9OC 9UbqerzmdrcYcgo6QjxjFe9sMC2XCzK711T65IfGijBoxglILikMc3kT99tPpQtV7RLZ29 qAyWGfosW4HAr/4HFjhevDBxvX3cHFaGxDzKwVeZV7dITgd3Dk76fZc0XaEWUV7l541MWl nJvvcmemKmH9gVaV8PZOGjM5eKYGwIrAJxLBSL5Gm9KVpwyCDJ9GHpvMLu+rtA== 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 027031AD0D; Thu, 27 Jan 2022 17:21:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 20RHKxu1077014; Thu, 27 Jan 2022 17:20:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20RHKxTf077013; Thu, 27 Jan 2022 17:20:59 GMT (envelope-from git) Date: Thu, 27 Jan 2022 17:20:59 GMT Message-Id: <202201271720.20RHKxTf077013@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Tom Jones Subject: git: 21c966a6b9f2 - main - 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: thj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 21c966a6b9f2e9110b8dc2a822ad2b4583f4f18b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643304060; 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=M4u2430Z1oSQRrFq1/NcQRQn7Ju+SROUxRALn38yhyk=; b=p5busNJk3lMYJaXbzkoBeq5mDqjw2LOPb5jI9LTPqDYIbWS/MhtBbM3MwVeYJplmPbFZUm TUG5F45oc9T7m7oR3EiroJTu/L6w7r9g5+5psDo98iLXUdkkDkJgi79gO4Hf5JUDrIqcXo vh+rW9vkIwwV9DkPNpsd+7+AdDJazNo04yFug8fHMLtYZSPE+LoNtgnrpfsWHnbzhJ6Ys4 iV3Hf7ZDBogvYxfsPGFLWuMq2WvboXRL3W0GT5zf66edMRNwaH6koR3N6zBILm3bvhPU+Z meKWT6ay7/kcdxhByg/RQRJq08IPnMXFNMXy33/ielcTLnCweoDmUHXAyz50mg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1643304060; a=rsa-sha256; cv=none; b=BJZTBfjEpIpzGfyp2IWb46PoSPVW+T+M8W2fnLRucSuzMYCpbBayvRJKTer75doN3MgFhl 8nX6SX/rkH30IFelFLvpp5BraiwWYQr50kQ+JhoiSrC8K0yXLJ8bPRpwDksxREJFz4E7BE v4mvF38pFCNIGHZPnullyTt010aNji8ucEYtJpN3saGI7PgPMfqiKhrPebbBD4ZgUaSra6 2WpB6Uktje+WYmKnHK1s+HlDLJFY3W+bW5O7bRd2+/3f7eBIRooogOf/SulrBvMwLB8px1 O6ZTm4iLzCQ5BWcqcjvTUN6WLo8xrjfmCqtvTCoADL3HugIWTHiR6Ict1Dz2SQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by thj: URL: https://cgit.FreeBSD.org/src/commit/?id=21c966a6b9f2e9110b8dc2a822ad2b4583f4f18b commit 21c966a6b9f2e9110b8dc2a822ad2b4583f4f18b Author: Tom Jones AuthorDate: 2022-01-27 17:17:13 +0000 Commit: Tom Jones CommitDate: 2022-01-27 17:20:23 +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 --- 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 5128e7ed43e0..f31f744b93f6 100644 --- a/usr.bin/gzip/gzip.c +++ b/usr.bin/gzip/gzip.c @@ -1655,10 +1655,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 @@ -1683,8 +1686,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);