aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlandley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277>2005-12-16 21:33:10 +0000
committerlandley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277>2005-12-16 21:33:10 +0000
commit8ef77f9da8c62412431e23f78756c5d7d93b5eed (patch)
tree702ca9b29df658fd8b531346cc69a81892078dc8
parenta87138a9dcd1fab48fa4115bdb238b9f22192f36 (diff)
downloadbusybox-w32-8ef77f9da8c62412431e23f78756c5d7d93b5eed.tar.gz
busybox-w32-8ef77f9da8c62412431e23f78756c5d7d93b5eed.tar.bz2
busybox-w32-8ef77f9da8c62412431e23f78756c5d7d93b5eed.zip
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(). git-svn-id: svn://busybox.net/trunk/busybox@12941 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r--archival/tar.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/archival/tar.c b/archival/tar.c
index b2967463e..cd89a7566 100644
--- a/archival/tar.c
+++ b/archival/tar.c
@@ -513,11 +513,12 @@ static inline int writeTarFile(const int tar_fd, const int verboseFlag,
513 * but that isn't necessary for GNU tar interoperability, and 513 * but that isn't necessary for GNU tar interoperability, and
514 * so is considered a waste of space */ 514 * so is considered a waste of space */
515 515
516 /* Close so the child process (if any) will exit */
517 close(tbInfo.tarFd);
518
516 /* Hang up the tools, close up shop, head home */ 519 /* Hang up the tools, close up shop, head home */
517 if (ENABLE_FEATURE_CLEAN_UP) { 520 if (ENABLE_FEATURE_CLEAN_UP)
518 close(tbInfo.tarFd);
519 freeHardLinkInfo(&tbInfo.hlInfoHead); 521 freeHardLinkInfo(&tbInfo.hlInfoHead);
520 }
521 522
522 if (errorFlag) 523 if (errorFlag)
523 bb_error_msg("Error exit delayed from previous errors"); 524 bb_error_msg("Error exit delayed from previous errors");