[git commit] tar: fix a thinko in prev commit - we need to copy to _unused_ fd

Denys Vlasenko vda.linux at googlemail.com
Sat Aug 4 19:06:02 UTC 2018


commit: https://git.busybox.net/busybox/commit/?id=2005d3ff3661220f11e8ff1911b24051b3669566
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master

function                                             old     new   delta
vfork_compressor                                     257     246     -11

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 archival/tar.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/archival/tar.c b/archival/tar.c
index 120c77f3b..1c71f7f66 100644
--- a/archival/tar.c
+++ b/archival/tar.c
@@ -632,8 +632,7 @@ static void NOINLINE vfork_compressor(int tar_fd, const char *gzip)
 			 * Swapping move_fd's order wouldn't work:
 			 * data.rd is 1 and _it_ would be destroyed.
 			 */
-			xmove_fd(tfd, 3);
-			tfd = 3;
+			tfd = dup(tfd);
 		}
 		xmove_fd(data.rd, 0);
 		xmove_fd(tfd, 1);


More information about the busybox-cvs mailing list