NetBSD Problem Report #25189

Received: (qmail 2461 invoked by uid 605); 15 Apr 2004 10:43:20 -0000
Message-Id: <20040415104319.414731116E@narn.netbsd.org>
Date: Thu, 15 Apr 2004 10:43:19 +0000 (UTC)
From: tshiozak@netbsd.org
Sender: gnats-bugs-owner@NetBSD.org
Reply-To: tshiozak@netbsd.org
To: gnats-bugs@gnats.NetBSD.org
Subject: zcat (gzip -cd) fails with multiple files.
X-Send-Pr-Version: www-1.0

>Number:         25189
>Category:       bin
>Synopsis:       zcat (gzip -cd) fails with multiple files.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    mrg
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Apr 15 10:44:00 +0000 2004
>Closed-Date:    Thu Apr 15 13:07:19 +0000 2004
>Last-Modified:  Mon Jul 12 02:54:23 +0000 2004
>Originator:     Takuya SHIOZAKI
>Release:        current
>Organization:
---
>Environment:
NetBSD aoi.prod.astec.co.jp 2.0B NetBSD 2.0B (AOI) #4: Tue Apr  6 18:09:28 JST 2004  tshiozak@aoi.prod.astec.co.jp:/usr/home/current-build/src/sys/arch/i386/compile/AOI i386
>Description:
gzip -cd and zcat fails to uncompress multiple files.


>How-To-Repeat:
% zcat a.gz b.gz > /dev/null
zcat: failed fwrite: Bad file descriptor

>Fix:
file_uncompress() in gzip.c:

   845                  if (cflag == 0) {
...snip...
   855                  } else
   856                          out = stdout;
   857  
   858                  if ((size = gz_uncompress(in, out)) == 0) {
   859                          unlink(outfile);
   860                          goto lose;
   861                  }
   862                  if (fclose(out))
   863                          maybe_err(1, "failed fclose");

this fclose() is unnecessary if cflags != 0.

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: mrg 
State-Changed-When: Thu Apr 15 13:06:58 UTC 2004 
State-Changed-Why:  
this was fixed in -current 3 or so days ago. 

From: James Chacon <jmc@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:  
Subject: pr/25189 CVS commit: [netbsd-2-0] src/usr.bin/gzip
Date: Sun, 18 Apr 2004 02:14:55 +0000 (UTC)

 Module Name:	src
 Committed By:	jmc
 Date:		Sun Apr 18 02:14:55 UTC 2004

 Modified Files:
 	src/usr.bin/gzip [netbsd-2-0]: gzip.c

 Log Message:
 Pullup rev 1.36 (requested by mrg in ticket #146)

 Don't try to remove an output file we haven't actually created. PR#25189


 To generate a diff of this commit:
 cvs rdiff -r1.29.2.5 -r1.29.2.6 src/usr.bin/gzip/gzip.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

Responsible-Changed-From-To: bin-bug-people->mrg 
Responsible-Changed-By: mrg 
Responsible-Changed-When: Mon Jul 12 02:54:09 UTC 2004 
Responsible-Changed-Why:  
this was mine.. 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.