summaryrefslogtreecommitdiffstats
path: root/contrib/tar/src
diff options
context:
space:
mode:
authorsobomax <sobomax@FreeBSD.org>2002-10-02 08:42:06 +0000
committersobomax <sobomax@FreeBSD.org>2002-10-02 08:42:06 +0000
commit14ecf3b5d45aec16289a4820158a4613dea1e0fd (patch)
tree1389282172cb6ffef4d193db660909cc9b46c542 /contrib/tar/src
parent73d23540ae1d0a77fa8be27264e676840fd5b15c (diff)
downloadFreeBSD-src-14ecf3b5d45aec16289a4820158a4613dea1e0fd.zip
FreeBSD-src-14ecf3b5d45aec16289a4820158a4613dea1e0fd.tar.gz
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
Diffstat (limited to 'contrib/tar/src')
-rw-r--r--contrib/tar/src/buffer.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/contrib/tar/src/buffer.c b/contrib/tar/src/buffer.c
index 2749aad..31aef37 100644
--- a/contrib/tar/src/buffer.c
+++ b/contrib/tar/src/buffer.c
@@ -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. */
OpenPOWER on IntegriCloud