blob: 793b161a16cb41f9743fa98fe13a85a75f1eeee5 [file] [log] [blame]
"Robert P. J. Day"63fc1a92006-07-02 19:47:05 +00001/* vi: set sw=4 ts=4: */
Glenn L McGrath7ca04f32002-09-25 02:47:48 +00002/*
Denys Vlasenko0ef64bd2010-08-16 20:14:46 +02003 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
Glenn L McGrath7ca04f32002-09-25 02:47:48 +00004 */
Glenn L McGrath7ca04f32002-09-25 02:47:48 +00005#include "libbb.h"
Denys Vlasenkod184a722011-09-22 12:45:14 +02006#include "bb_archive.h"
Glenn L McGrath7ca04f32002-09-25 02:47:48 +00007
Denis Vlasenkodefc1ea2008-06-27 02:52:20 +00008char FAST_FUNC get_header_tar_gz(archive_handle_t *archive_handle)
Glenn L McGrath7ca04f32002-09-25 02:47:48 +00009{
Denis Vlasenkoe1a0d482006-10-20 13:28:22 +000010 /* Can't lseek over pipes */
Denis Vlasenko13858992006-10-08 12:49:22 +000011 archive_handle->seek = seek_by_read;
Glenn L McGrath5699b852003-11-15 23:19:05 +000012
Denys Vlasenkob4c11c12014-12-07 00:44:00 +010013 fork_transformer_with_sig(archive_handle->src_fd, unpack_gz_stream, "gunzip");
Glenn L McGrath2e41d0c2002-09-27 06:46:02 +000014 archive_handle->offset = 0;
Denis Vlasenko476b0702007-09-09 14:11:11 +000015 while (get_header_tar(archive_handle) == EXIT_SUCCESS)
16 continue;
Glenn L McGrath7ca04f32002-09-25 02:47:48 +000017
Glenn L McGrath5699b852003-11-15 23:19:05 +000018 /* Can only do one file at a time */
Denis Vlasenko13858992006-10-08 12:49:22 +000019 return EXIT_FAILURE;
Glenn L McGrath7ca04f32002-09-25 02:47:48 +000020}