aboutsummaryrefslogtreecommitdiff
path: root/archival/tar.c
diff options
context:
space:
mode:
Diffstat (limited to 'archival/tar.c')
-rw-r--r--archival/tar.c28
1 files changed, 5 insertions, 23 deletions
diff --git a/archival/tar.c b/archival/tar.c
index c57bff779..c7642a50e 100644
--- a/archival/tar.c
+++ b/archival/tar.c
@@ -601,8 +601,7 @@ static int FAST_FUNC writeFileToTarball(const char *fileName, struct stat *statb
601 return TRUE; 601 return TRUE;
602} 602}
603 603
604#if SEAMLESS_COMPRESSION 604# if SEAMLESS_COMPRESSION && !ENABLE_PLATFORM_MINGW32
605#if !ENABLE_PLATFORM_MINGW32
606/* Don't inline: vfork scares gcc and pessimizes code */ 605/* Don't inline: vfork scares gcc and pessimizes code */
607static void NOINLINE vfork_compressor(int tar_fd, const char *gzip) 606static void NOINLINE vfork_compressor(int tar_fd, const char *gzip)
608{ 607{
@@ -677,28 +676,11 @@ static void NOINLINE vfork_compressor(int tar_fd, const char *gzip)
677 bb_perror_msg_and_die("can't execute '%s'", gzip); 676 bb_perror_msg_and_die("can't execute '%s'", gzip);
678 } 677 }
679} 678}
680#else 679# endif /* SEAMLESS_COMPRESSION */
681static pid_t vfork_compressor(int tar_fd, const char *gzip)
682{
683 char *cmd;
684 int fd1;
685 pid_t pid;
686 680
687 if (find_applet_by_name(gzip) >= 0) { 681# if ENABLE_PLATFORM_MINGW32
688 cmd = xasprintf("%s --busybox %s -cf -", bb_busybox_exec_path, gzip); 682# define vfork_compressor(f, g) mingw_fork_compressor((f), (g), "w")
689 } 683# endif
690 else {
691 cmd = xasprintf("%s -cf -", gzip);
692 }
693 if ( (fd1=mingw_popen_fd(cmd, "w", tar_fd, &pid)) == -1 ) {
694 bb_perror_msg_and_die("can't execute '%s'", gzip);
695 }
696 free(cmd);
697 xmove_fd(fd1, tar_fd);
698 return pid;
699}
700#endif /* ENABLE_PLATFORM_MINGW32 */
701#endif /* SEAMLESS_COMPRESSION */
702 684
703 685
704# if !SEAMLESS_COMPRESSION 686# if !SEAMLESS_COMPRESSION