From owner-freebsd-questions Sat Apr 22 0:21:29 2000 Delivered-To: freebsd-questions@freebsd.org Received: from camelot.bitart.com (BITart-45.BITart.com [206.103.221.45]) by hub.freebsd.org (Postfix) with SMTP id 34FFA37B6B5 for ; Sat, 22 Apr 2000 00:21:21 -0700 (PDT) (envelope-from gerti@bitart.com) Received: (qmail 28825 invoked by uid 101); 22 Apr 2000 07:21:17 -0000 Message-ID: <20000422072117.28824.qmail@camelot.bitart.com> Content-Type: text/plain MIME-Version: 1.0 (NeXT Mail 4.2mach v148) X-Nextstep-Mailer: Mail 4.2mach (Enhance 2.2p1) Received: by NeXT.Mailer (1.148) From: Gerd Knops Date: Sat, 22 Apr 2000 02:21:16 -0500 To: freebsd-questions@FreeBSD.ORG Subject: How to submit patch for GNU tar? Reply-To: gerti-freebsdq@BITart.com Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi Everyone, Looking through the news archives I see many people thinking something may be wrong when 'gnutar -xzf' occasionally spits out Broken pipe; child returned status 1 Doing a little research the reason appears to be that gnutar sometimes finds the end of an archive when gunzip still wants to send some final null bytes (something about differing block sizes). A small patch (sample below) could avoid this: Read any pending data from the pipe to gunzip before closing it. I am not absolutely sure however if that patch has side effects in one of the many many modes gnutar supports. gnutar seems to have no current maintainer, nor does the gnu.org site provide any obvious means to supply patches. Any suggestions how to procede with this? Thanks Gerd --- buffer.c.orig Wed Jan 11 04:18:37 1995 +++ buffer.c Sat Apr 22 02:20:06 2000 @@ -1253,7 +1253,17 @@ } if (f_verify) verify_volume (); - + + if(childpid && f_compressprog && ar_reading) + { + /* + * Read from decompressor until EOF to avoid + * 'Broken pipe' message from child + */ + char dum_buf[256]; + while(rmtread (archive, dum_buf, 256)>0); + } + if ((c = rmtclose (archive)) < 0) msg_perror ("Warning: can't close %s(%d,%d)", ar_files[cur_ar_file], archive, c); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message