Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Oct 2002 11:49:12 +1000
From:      Tim Robbins <tjr@FreeBSD.org>
To:        Gordon Tetlow <gordont@gnf.org>
Cc:        current@FreeBSD.org
Subject:   Re: tar problems with --fast-read
Message-ID:  <20021009114912.A25136@dilbert.robbins.dropbear.id.au>
In-Reply-To: <20021008170109.GA389@roark.gnf.org>; from gordont@gnf.org on Tue, Oct 08, 2002 at 10:01:09AM -0700
References:  <20021008170109.GA389@roark.gnf.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Oct 08, 2002 at 10:01:09AM -0700, Gordon Tetlow wrote:

> I was trying out the fast-read feature of tar and got the following:
> 
> gtetlow@roark:~$ touch testa testb
> gtetlow@roark:~$ tar cf test.tar testa testb                             
> gtetlow@roark:~$ tar tf test.tar --fast-read testa
> testa
> Terminated
> gtetlow@roark:~$ 
> 
> Further investigtion shows that there is a SIGPIPE being delivered.
> Any ideas?

Looks like it's doing kill(0, SIGTERM) and killing itself when fast-read is
used and there is no child process (gzip). This is consistent with the
fact that if you add "gzip test.tar" between your second and third command,
and change the third to "tar tfz ...", it doesn't seem to terminate itself. 

Try this patch:

Index: buffer.c
===================================================================
RCS file: /home/tim/freebsd/src/contrib/tar/src/buffer.c,v
retrieving revision 1.4
diff -u -r1.4 buffer.c
--- buffer.c	2 Oct 2002 08:42:06 -0000	1.4
+++ buffer.c	9 Oct 2002 01:36:48 -0000
@@ -1339,7 +1339,7 @@
      might become clever enough to just stop working, once there is no more
      work to do, we might have to revise this area in such time.  */
 
-  if (fast_read_option && namelist_freed)
+  if (fast_read_option && namelist_freed && child_pid > 0)
     kill(child_pid, SIGTERM);
 
   if (access_mode == ACCESS_READ



Tim

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021009114912.A25136>