aboutsummaryrefslogtreecommitdiff
path: root/archival
diff options
context:
space:
mode:
Diffstat (limited to 'archival')
-rw-r--r--archival/libunarchive/Kbuild2
-rw-r--r--archival/libunarchive/get_header_tar_bz2.c2
-rw-r--r--archival/libunarchive/get_header_tar_gz.c2
-rw-r--r--archival/libunarchive/get_header_tar_lzma.c2
-rw-r--r--archival/libunarchive/open_transformer.c19
-rw-r--r--archival/rpm.c2
-rw-r--r--archival/tar.c2
7 files changed, 15 insertions, 16 deletions
diff --git a/archival/libunarchive/Kbuild b/archival/libunarchive/Kbuild
index 1bc054a96..609bc50cb 100644
--- a/archival/libunarchive/Kbuild
+++ b/archival/libunarchive/Kbuild
@@ -43,6 +43,8 @@ lib-$(CONFIG_FEATURE_DEB_TAR_GZ) += open_transformer.o
43lib-$(CONFIG_FEATURE_DEB_TAR_BZ2) += open_transformer.o 43lib-$(CONFIG_FEATURE_DEB_TAR_BZ2) += open_transformer.o
44lib-$(CONFIG_FEATURE_DEB_TAR_LZMA) += open_transformer.o 44lib-$(CONFIG_FEATURE_DEB_TAR_LZMA) += open_transformer.o
45 45
46lib-$(CONFIG_FEATURE_MODPROBE_SMALL_ZIPPED) += open_transformer.o decompress_unzip.o decompress_bunzip2.o
47
46lib-$(CONFIG_AR) += get_header_ar.o unpack_ar_archive.o 48lib-$(CONFIG_AR) += get_header_ar.o unpack_ar_archive.o
47lib-$(CONFIG_BUNZIP2) += decompress_bunzip2.o 49lib-$(CONFIG_BUNZIP2) += decompress_bunzip2.o
48lib-$(CONFIG_UNLZMA) += decompress_unlzma.o 50lib-$(CONFIG_UNLZMA) += decompress_unlzma.o
diff --git a/archival/libunarchive/get_header_tar_bz2.c b/archival/libunarchive/get_header_tar_bz2.c
index cfdc016d6..035c10bfb 100644
--- a/archival/libunarchive/get_header_tar_bz2.c
+++ b/archival/libunarchive/get_header_tar_bz2.c
@@ -11,7 +11,7 @@ char FAST_FUNC get_header_tar_bz2(archive_handle_t *archive_handle)
11 /* Can't lseek over pipes */ 11 /* Can't lseek over pipes */
12 archive_handle->seek = seek_by_read; 12 archive_handle->seek = seek_by_read;
13 13
14 archive_handle->src_fd = open_transformer(archive_handle->src_fd, unpack_bz2_stream, "bunzip2"); 14 open_transformer(archive_handle->src_fd, unpack_bz2_stream, "bunzip2");
15 archive_handle->offset = 0; 15 archive_handle->offset = 0;
16 while (get_header_tar(archive_handle) == EXIT_SUCCESS) 16 while (get_header_tar(archive_handle) == EXIT_SUCCESS)
17 continue; 17 continue;
diff --git a/archival/libunarchive/get_header_tar_gz.c b/archival/libunarchive/get_header_tar_gz.c
index 33c62729e..086c6df42 100644
--- a/archival/libunarchive/get_header_tar_gz.c
+++ b/archival/libunarchive/get_header_tar_gz.c
@@ -25,7 +25,7 @@ char FAST_FUNC get_header_tar_gz(archive_handle_t *archive_handle)
25 } 25 }
26#endif 26#endif
27 27
28 archive_handle->src_fd = open_transformer(archive_handle->src_fd, unpack_gz_stream, "gunzip"); 28 open_transformer(archive_handle->src_fd, unpack_gz_stream, "gunzip");
29 archive_handle->offset = 0; 29 archive_handle->offset = 0;
30 while (get_header_tar(archive_handle) == EXIT_SUCCESS) 30 while (get_header_tar(archive_handle) == EXIT_SUCCESS)
31 continue; 31 continue;
diff --git a/archival/libunarchive/get_header_tar_lzma.c b/archival/libunarchive/get_header_tar_lzma.c
index 730c1b1bb..03b1b792d 100644
--- a/archival/libunarchive/get_header_tar_lzma.c
+++ b/archival/libunarchive/get_header_tar_lzma.c
@@ -14,7 +14,7 @@ char FAST_FUNC get_header_tar_lzma(archive_handle_t *archive_handle)
14 /* Can't lseek over pipes */ 14 /* Can't lseek over pipes */
15 archive_handle->seek = seek_by_read; 15 archive_handle->seek = seek_by_read;
16 16
17 archive_handle->src_fd = open_transformer(archive_handle->src_fd, unpack_lzma_stream, "unlzma"); 17 open_transformer(archive_handle->src_fd, unpack_lzma_stream, "unlzma");
18 archive_handle->offset = 0; 18 archive_handle->offset = 0;
19 while (get_header_tar(archive_handle) == EXIT_SUCCESS) 19 while (get_header_tar(archive_handle) == EXIT_SUCCESS)
20 continue; 20 continue;
diff --git a/archival/libunarchive/open_transformer.c b/archival/libunarchive/open_transformer.c
index a5ee97167..42fdd96a6 100644
--- a/archival/libunarchive/open_transformer.c
+++ b/archival/libunarchive/open_transformer.c
@@ -11,7 +11,7 @@
11 * On MMU machine, the transform_prog is removed by macro magic 11 * On MMU machine, the transform_prog is removed by macro magic
12 * in include/unarchive.h. On NOMMU, transformer is removed. 12 * in include/unarchive.h. On NOMMU, transformer is removed.
13 */ 13 */
14int FAST_FUNC open_transformer(int src_fd, 14void FAST_FUNC open_transformer(int fd,
15 USE_DESKTOP(long long) int FAST_FUNC (*transformer)(int src_fd, int dst_fd), 15 USE_DESKTOP(long long) int FAST_FUNC (*transformer)(int src_fd, int dst_fd),
16 const char *transform_prog) 16 const char *transform_prog)
17{ 17{
@@ -32,20 +32,20 @@ int FAST_FUNC open_transformer(int src_fd,
32 32
33 if (pid == 0) { 33 if (pid == 0) {
34 /* child process */ 34 /* child process */
35 close(fd_pipe.rd); /* We don't want to read from the parent */ 35 close(fd_pipe.rd); /* we don't want to read from the parent */
36 // FIXME: error check? 36 // FIXME: error check?
37#if BB_MMU 37#if BB_MMU
38 transformer(src_fd, fd_pipe.wr); 38 transformer(fd, fd_pipe.wr);
39 if (ENABLE_FEATURE_CLEAN_UP) { 39 if (ENABLE_FEATURE_CLEAN_UP) {
40 close(fd_pipe.wr); /* Send EOF */ 40 close(fd_pipe.wr); /* send EOF */
41 close(src_fd); 41 close(fd);
42 } 42 }
43 /* must be _exit! bug was actually seen here */ 43 /* must be _exit! bug was actually seen here */
44 _exit(EXIT_SUCCESS); 44 _exit(EXIT_SUCCESS);
45#else 45#else
46 { 46 {
47 char *argv[4]; 47 char *argv[4];
48 xmove_fd(src_fd, 0); 48 xmove_fd(fd, 0);
49 xmove_fd(fd_pipe.wr, 1); 49 xmove_fd(fd_pipe.wr, 1);
50 argv[0] = (char*)transform_prog; 50 argv[0] = (char*)transform_prog;
51 argv[1] = (char*)"-cf"; 51 argv[1] = (char*)"-cf";
@@ -59,9 +59,6 @@ int FAST_FUNC open_transformer(int src_fd,
59 } 59 }
60 60
61 /* parent process */ 61 /* parent process */
62 close(fd_pipe.wr); /* Don't want to write to the child */ 62 close(fd_pipe.wr); /* don't want to write to the child */
63 63 xmove_fd(fd_pipe.rd, fd);
64//TODO: get rid of return value (become void)?
65 xmove_fd(fd_pipe.rd, src_fd);
66 return src_fd;
67} 64}
diff --git a/archival/rpm.c b/archival/rpm.c
index b3d7cd5f7..e6dd3d853 100644
--- a/archival/rpm.c
+++ b/archival/rpm.c
@@ -236,7 +236,7 @@ static void extract_cpio_gz(int fd)
236 } 236 }
237 237
238 xchdir("/"); /* Install RPM's to root */ 238 xchdir("/"); /* Install RPM's to root */
239 archive_handle->src_fd = open_transformer(archive_handle->src_fd, xformer, xformer_prog); 239 open_transformer(archive_handle->src_fd, xformer, xformer_prog);
240 archive_handle->offset = 0; 240 archive_handle->offset = 0;
241 while (get_header_cpio(archive_handle) == EXIT_SUCCESS) 241 while (get_header_cpio(archive_handle) == EXIT_SUCCESS)
242 continue; 242 continue;
diff --git a/archival/tar.c b/archival/tar.c
index 13cdbd930..a46442f8e 100644
--- a/archival/tar.c
+++ b/archival/tar.c
@@ -692,7 +692,7 @@ static char FAST_FUNC get_header_tar_Z(archive_handle_t *archive_handle)
692 bb_error_msg_and_die("invalid magic"); 692 bb_error_msg_and_die("invalid magic");
693 } 693 }
694 694
695 archive_handle->src_fd = open_transformer(archive_handle->src_fd, uncompress, "uncompress"); 695 open_transformer(archive_handle->src_fd, uncompress, "uncompress");
696 archive_handle->offset = 0; 696 archive_handle->offset = 0;
697 while (get_header_tar(archive_handle) == EXIT_SUCCESS) 697 while (get_header_tar(archive_handle) == EXIT_SUCCESS)
698 continue; 698 continue;