svn commit: trunk/busybox/archival

landley at busybox.net landley at busybox.net
Fri Dec 16 21:33:11 UTC 2005


Author: landley
Date: 2005-12-16 13:33:10 -0800 (Fri, 16 Dec 2005)
New Revision: 12941

Log:
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().


Modified:
   trunk/busybox/archival/tar.c


Changeset:
Modified: trunk/busybox/archival/tar.c
===================================================================
--- trunk/busybox/archival/tar.c	2005-12-16 19:28:49 UTC (rev 12940)
+++ trunk/busybox/archival/tar.c	2005-12-16 21:33:10 UTC (rev 12941)
@@ -513,11 +513,12 @@
 	 * 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");




More information about the busybox-cvs mailing list