From owner-freebsd-current Tue Oct 8 18:49:21 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6E49937B401 for ; Tue, 8 Oct 2002 18:49:20 -0700 (PDT) Received: from smtp02.iprimus.net.au (smtp02.iprimus.net.au [210.50.76.70]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8577E43E7B for ; Tue, 8 Oct 2002 18:49:19 -0700 (PDT) (envelope-from tim@robbins.dropbear.id.au) Received: from dilbert.robbins.dropbear.id.au ([210.50.113.28]) by smtp02.iprimus.net.au with Microsoft SMTPSVC(5.0.2195.4617); Wed, 9 Oct 2002 11:49:16 +1000 Received: from dilbert.robbins.dropbear.id.au (etwaqmbrr5yu1x0h@localhost [127.0.0.1]) by dilbert.robbins.dropbear.id.au (8.12.6/8.12.6) with ESMTP id g991nF4q025708; Wed, 9 Oct 2002 11:49:15 +1000 (EST) (envelope-from tim@dilbert.robbins.dropbear.id.au) Received: (from tim@localhost) by dilbert.robbins.dropbear.id.au (8.12.6/8.12.6/Submit) id g991nCac025707; Wed, 9 Oct 2002 11:49:12 +1000 (EST) (envelope-from tim) Date: Wed, 9 Oct 2002 11:49:12 +1000 From: Tim Robbins To: Gordon Tetlow Cc: current@FreeBSD.org Subject: Re: tar problems with --fast-read Message-ID: <20021009114912.A25136@dilbert.robbins.dropbear.id.au> References: <20021008170109.GA389@roark.gnf.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20021008170109.GA389@roark.gnf.org>; from gordont@gnf.org on Tue, Oct 08, 2002 at 10:01:09AM -0700 X-OriginalArrivalTime: 09 Oct 2002 01:49:17.0508 (UTC) FILETIME=[140C9040:01C26F36] Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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