1 From ppe@pa.uky.edu Sun Mar 28 13:38:30 1999
2 Return-Path: <ppe@pa.uky.edu>
3 Received: from lacrosse.redhat.com (root@lacrosse.redhat.com [207.175.42.154])
4 by devserv.devel.redhat.com (8.8.7/8.8.7) with ESMTP id NAA08073
5 for <jbj@devserv.devel.redhat.com>; Sun, 28 Mar 1999 13:38:29 -0500
6 Received: from mail.redhat.com (mail.redhat.com [199.183.24.239])
7 by lacrosse.redhat.com (8.8.7/8.8.7) with ESMTP id NAA06103
8 for <jbj@lacrosse.redhat.com>; Sun, 28 Mar 1999 13:38:28 -0500
9 Received: from server1.pa.uky.edu (server1.pa.uky.edu [128.163.161.40])
10 by mail.redhat.com (8.8.7/8.8.7) with SMTP id NAA28286
11 for <jbj@redhat.com>; Sun, 28 Mar 1999 13:38:27 -0500
12 Received: from node-03-05.dialin.uky.edu by server1.pa.uky.edu (5.65v4.0/1.1.10.5/27Dec96-0538PM)
13 id AA05317; Sun, 28 Mar 1999 13:38:25 -0500
14 Received: (from ppe@localhost)
15 by pa.uky.edu (8.8.7/8.8.7) id NAA05145
16 for jbj@redhat.com; Sun, 28 Mar 1999 13:38:22 -0500
17 From: Peter Englmaier <ppe@pa.uky.edu>
18 Message-Id: <199903281838.NAA05145@pa.uky.edu>
19 Subject: [Bug 390] Changed - tar with compression over pipe produces error
21 Date: Sun, 28 Mar 1999 13:38:22 -0500 (EST)
22 X-Mailer: ELM [version 2.4ME+ PL32 (25)]
24 Content-Type: text/plain; charset=US-ASCII
25 Content-Transfer-Encoding: 7bit
30 ----- Forwarded message from bugzilla@redhat.com -----
32 +------- Additional Comments From jbj@redhat.com 03/27/99 18:17 -------
33 +If I apply your patch, does that also fix the original problem (
34 +using tar z within ftp)?
36 ----- End of forwarded message from bugzilla@redhat.com -----
40 yes, I think it will solve the original problem as well. However,
41 I could net yet test it under the same conditions (with slow remote
42 ftp server). When I do it locally, the error shows up when ftp is
43 suspended (ctrl-Z) for a few seconds and than restarted (fg). With
44 the new tar version the error does not show up and the transfer
45 is just fine. Here is an improved patch, which also tests for possible
46 real errors with the pipe (e.g. EPIPE). Error handling is done
47 by jumping out of the loop with status!=record_size.
52 diff -rC 2 tar-1.12.orig/src/buffer.c tar-1.12/src/buffer.c
53 *** tar-1.12.orig/src/buffer.c Fri Apr 25 09:48:46 1997
54 --- tar-1.12/src/buffer.c Sun Mar 28 13:22:32 1999
62 if (checkpoint_option && !(++checkpoint % 10))
66 else if (dev_null_output)
68 + else if (S_ISFIFO(archive_stat.st_mode)) {/*ppe: fix writing over a pipe */
71 + while (status != record_size && written >=0 ) {
72 + written=rmtwrite (archive, record_start->buffer+status,
73 + (unsigned int) (record_size-status));
74 + if (written>=0) status += written;
78 status = rmtwrite (archive, record_start->buffer,