Date: Sat, 22 Apr 2000 02:21:16 -0500 From: Gerd Knops <gerti@bitart.com> To: freebsd-questions@FreeBSD.ORG Subject: How to submit patch for GNU tar? Message-ID: <20000422072117.28824.qmail@camelot.bitart.com>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000422072117.28824.qmail>