Move from read_gz to the pipe()+fork() method.

open_transformer(), common code for pipe+fork.
Function pointer for read() no longer needed.
Allow inflate to be initialised with a specified buffer size to avoid
over-reading.
Reset static variables in inflate_get_next_window to fix a bug where
only the first file in a .zip would be be extracted.
This commit is contained in:
Glenn L McGrath
2003-11-15 23:19:05 +00:00
parent 54ac057c00
commit 5699b8525e
16 changed files with 156 additions and 284 deletions

View File

@@ -197,7 +197,6 @@ void extract_cpio_gz(int fd) {
/* Initialise */
archive_handle = init_handle();
archive_handle->read = read_gz;
archive_handle->seek = seek_by_char;
//archive_handle->action_header = header_list;
archive_handle->action_data = data_extract_all;
@@ -213,11 +212,9 @@ void extract_cpio_gz(int fd) {
check_header_gzip(archive_handle->src_fd);
chdir("/"); // Install RPM's to root
GZ_gzReadOpen(archive_handle->src_fd, 0, 0);
archive_handle->src_fd = open_transformer(archive_handle->src_fd, inflate_gunzip);
archive_handle->offset = 0;
while (get_header_cpio(archive_handle) == EXIT_SUCCESS);
GZ_gzReadClose();
check_trailer_gzip(archive_handle->src_fd);
}