From owner-svn-src-stable-10@freebsd.org Mon Nov 9 01:53:56 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7AE7FA2486D; Mon, 9 Nov 2015 01:53:56 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E07D1E6E; Mon, 9 Nov 2015 01:53:56 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tA91rtrH086377; Mon, 9 Nov 2015 01:53:55 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tA91rt5P086375; Mon, 9 Nov 2015 01:53:55 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201511090153.tA91rt5P086375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 9 Nov 2015 01:53:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290569 - stable/10/usr.bin/gzip X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2015 01:53:56 -0000 Author: delphij Date: Mon Nov 9 01:53:54 2015 New Revision: 290569 URL: https://svnweb.freebsd.org/changeset/base/290569 Log: MFC r290024,290073: In gunzip(1), treat trailing garbage as a warning and not an error. This allows scripts to distinguish it between real fatal errors, for instance a CRC mismatch. Update manual page for the behavior change. PR: bin/203873 Submitted by: Eugene Grosbein Modified: stable/10/usr.bin/gzip/gzip.1 stable/10/usr.bin/gzip/gzip.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/gzip/gzip.1 ============================================================================== --- stable/10/usr.bin/gzip/gzip.1 Mon Nov 9 01:49:25 2015 (r290568) +++ stable/10/usr.bin/gzip/gzip.1 Mon Nov 9 01:53:54 2015 (r290569) @@ -1,4 +1,4 @@ -.\" $NetBSD: gzip.1,v 1.25 2015/04/06 21:41:17 wiz Exp $ +.\" $NetBSD: gzip.1,v 1.26 2015/10/27 07:36:18 mrg Exp $ .\" .\" Copyright (c) 1997, 2003, 2004 Matthew R. Green .\" All rights reserved. @@ -25,7 +25,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd April 6, 2015 +.Dd October 26, 2015 .Dt GZIP 1 .Os .Sh NAME @@ -136,7 +136,7 @@ option, allowing non-compressed data to .It Fl h , -help This option prints a usage summary and exits. .It Fl k , -keep -Keep (don't delete) input files during compression +Keep (do not delete) input files during compression or decompression. .It Fl L , -license This option prints @@ -183,6 +183,12 @@ is set, it is parsed as a white-space se handled before any options on the command line. Options on the command line will override anything in .Ev GZIP . +.Sh EXIT STATUS +The +.Nm +utility exits 0 on success, +1 on errors, +and 2 if a warning occurs. .Sh SEE ALSO .Xr bzip2 1 , .Xr compress 1 , @@ -220,7 +226,7 @@ with unpack support written by .An Xin LI Aq delphij@FreeBSD.org . .Sh BUGS According to RFC 1952, the recorded file size is stored in a 32-bit -integer, therefore, it can not represent files larger than 4GB. +integer, therefore, it cannot represent files larger than 4GB. This limitation also applies to .Fl l option of Modified: stable/10/usr.bin/gzip/gzip.c ============================================================================== --- stable/10/usr.bin/gzip/gzip.c Mon Nov 9 01:49:25 2015 (r290568) +++ stable/10/usr.bin/gzip/gzip.c Mon Nov 9 01:53:54 2015 (r290569) @@ -1,4 +1,4 @@ -/* $NetBSD: gzip.c,v 1.108 2015/04/15 02:29:12 christos Exp $ */ +/* $NetBSD: gzip.c,v 1.109 2015/10/27 07:36:18 mrg Exp $ */ /*- * Copyright (c) 1997, 1998, 2003, 2004, 2006 Matthew R. Green @@ -810,6 +810,7 @@ gz_uncompress(int in, int out, char *pre if (in_tot > 0) { maybe_warnx("%s: trailing garbage " "ignored", filename); + exit_value = 2; goto stop; } maybe_warnx("input not gziped (MAGIC0)");