aboutsummaryrefslogtreecommitdiff
path: root/toys/posix/tar.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2023-02-07 15:42:19 -0600
committerRob Landley <rob@landley.net>2023-02-07 15:42:19 -0600
commita3fc87752193cc9fb406b4c4b152e4ffb435dce5 (patch)
tree79bcb9e21dd5522e054e5bb97b39a1c4b237cd1d /toys/posix/tar.c
parent26e0b44c9dac19799bf68b882ed6db462a90240f (diff)
downloadtoybox-a3fc87752193cc9fb406b4c4b152e4ffb435dce5.tar.gz
Don't kill archiver now we're listening for its exit code,
shut it up by draining the trailing zeroes instead. Note: cpio lets you concatenate archives, but tar ignores everything after two zero blocks.
Diffstat (limited to 'toys/posix/tar.c')
-rw-r--r--toys/posix/tar.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/toys/posix/tar.c b/toys/posix/tar.c
index 3a399863..3e2a2153 100644
--- a/toys/posix/tar.c
+++ b/toys/posix/tar.c
@@ -1118,7 +1118,7 @@ void tar_main(void)
unpack_tar(hdr);
dirflush(0, 0);
// Shut up archiver about inability to write all trailing NULs to pipe buf
- if (TT.pid>0) kill(TT.pid, 9);
+ while (0<read(TT.fd, toybuf, sizeof(toybuf)));
// Each time a TT.incl entry is seen it's moved to the end of the list,
// with TT.seen pointing to first seen list entry. Anything between