Further improve --fast-read mode - when reading archive from stdin ensure that

SIGTERM we are sending to decompressor when there is nothing left to do is
actually delivered to decompressor, not to the another copy of tar, which
does unblocking.

MFC after:	2 weeks
This commit is contained in:
sobomax 2002-10-02 08:42:06 +00:00
parent 73d23540ae
commit 14ecf3b5d4

View File

@ -106,6 +106,7 @@ static int volno = 1; /* which volume of a multi-volume tape we're
on */
static int global_volno = 1; /* volume number to print in external
messages */
static pid_t grandchild_pid;
/* The pointer save_name, which is set in function dump_file() of module
create.c, points to the original long filename instead of the new,
@ -318,7 +319,6 @@ child_open_for_compress (void)
{
int parent_pipe[2];
int child_pipe[2];
pid_t grandchild_pid;
int wait_status;
xpipe (parent_pipe);
@ -480,13 +480,19 @@ child_open_for_compress (void)
exit (exit_status);
}
static void
sig_propagate(int sig)
{
kill (grandchild_pid, sig);
exit (TAREXIT_FAILURE);
}
/* Set ARCHIVE for uncompressing, then reading an archive. */
static void
child_open_for_uncompress (void)
{
int parent_pipe[2];
int child_pipe[2];
pid_t grandchild_pid;
int wait_status;
xpipe (parent_pipe);
@ -549,6 +555,7 @@ child_open_for_uncompress (void)
}
/* The child tar is still here! */
signal (SIGTERM, sig_propagate);
/* Prepare for unblocking the data from the archive into the
uncompressor. */