aboutsummaryrefslogtreecommitdiff
path: root/archival
diff options
context:
space:
mode:
Diffstat (limited to 'archival')
-rw-r--r--archival/libarchive/open_transformer.c16
-rw-r--r--archival/tar.c28
2 files changed, 6 insertions, 38 deletions
diff --git a/archival/libarchive/open_transformer.c b/archival/libarchive/open_transformer.c
index 1ac72af79..3d202ad26 100644
--- a/archival/libarchive/open_transformer.c
+++ b/archival/libarchive/open_transformer.c
@@ -154,21 +154,7 @@ void FAST_FUNC fork_transformer(int fd, const char *transform_prog)
154#else /* ENABLE_PLATFORM_MINGW */ 154#else /* ENABLE_PLATFORM_MINGW */
155void FAST_FUNC fork_transformer(int fd, const char *transform_prog) 155void FAST_FUNC fork_transformer(int fd, const char *transform_prog)
156{ 156{
157 char *cmd; 157 mingw_fork_compressor(fd, transform_prog, "r");
158 int fd1;
159
160 if (find_applet_by_name(transform_prog) >= 0) {
161 cmd = xasprintf("%s --busybox %s -cf -", bb_busybox_exec_path,
162 transform_prog);
163 }
164 else {
165 cmd = xasprintf("%s -cf -", transform_prog);
166 }
167 if ( (fd1=mingw_popen_fd(cmd, "r", fd, NULL)) == -1 ) {
168 bb_perror_msg_and_die("can't execute '%s'", transform_prog);
169 }
170 free(cmd);
171 xmove_fd(fd1, fd);
172} 158}
173#endif 159#endif
174 160
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