diff options
author | Ron Yorston <rmy@pobox.com> | 2020-08-05 15:33:12 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2020-08-05 15:33:12 +0100 |
commit | 4319228f3dcf3a5f941140482c30cca227c6ed0b (patch) | |
tree | 6d1203b9607d2f60ef503555872391d881da6163 /archival/libarchive | |
parent | b5fb54b4ac78c801dc4fa7a5b12dd6e296e52f3f (diff) | |
download | busybox-w32-4319228f3dcf3a5f941140482c30cca227c6ed0b.tar.gz busybox-w32-4319228f3dcf3a5f941140482c30cca227c6ed0b.tar.bz2 busybox-w32-4319228f3dcf3a5f941140482c30cca227c6ed0b.zip |
win32: move code to fork (de)compressor to a function
Use a new common function, mingw_fork_compressor(), to implement
fork_transformer() in open_transformer.c and vfork_compressor()
in tar.c.
Saves 160 bytes.
Diffstat (limited to 'archival/libarchive')
-rw-r--r-- | archival/libarchive/open_transformer.c | 16 |
1 files changed, 1 insertions, 15 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 */ |
155 | void FAST_FUNC fork_transformer(int fd, const char *transform_prog) | 155 | void 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 | ||