summaryrefslogtreecommitdiff
path: root/archival/tar.c
diff options
context:
space:
mode:
authorRob Landley2005-12-16 21:33:10 +0000
committerRob Landley2005-12-16 21:33:10 +0000
commit1a78103306e149321c6509514ea350c822815f3f (patch)
tree702ca9b29df658fd8b531346cc69a81892078dc8 /archival/tar.c
parentef1f7b5058c100990ec2e20484db39658b7b8343 (diff)
downloadbusybox-1a78103306e149321c6509514ea350c822815f3f.zip
busybox-1a78103306e149321c6509514ea350c822815f3f.tar.gz
Bug 601: When we fork an archiver and feed stuff to it through a pipe, if
we don't close the pipe the child process won't exit, and we'll hang in waitpid().
Diffstat (limited to 'archival/tar.c')
-rw-r--r--archival/tar.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/archival/tar.c b/archival/tar.c
index b296746..cd89a75 100644
--- a/archival/tar.c
+++ b/archival/tar.c
@@ -513,11 +513,12 @@ static inline int writeTarFile(const int tar_fd, const int verboseFlag,
* but that isn't necessary for GNU tar interoperability, and
* so is considered a waste of space */
+ /* Close so the child process (if any) will exit */
+ close(tbInfo.tarFd);
+
/* Hang up the tools, close up shop, head home */
- if (ENABLE_FEATURE_CLEAN_UP) {
- close(tbInfo.tarFd);
+ if (ENABLE_FEATURE_CLEAN_UP)
freeHardLinkInfo(&tbInfo.hlInfoHead);
- }
if (errorFlag)
bb_error_msg("Error exit delayed from previous errors");