Abstract read and seek in unarchiving code, convert bunzip to file descriptors, support tar -j

This commit is contained in:
Glenn L McGrath
2002-11-03 14:05:15 +00:00
parent 2fc54a9258
commit 237ae42fc9
28 changed files with 466 additions and 332 deletions

View File

@@ -29,7 +29,10 @@ extern char get_header_tar_gz(archive_handle_t *archive_handle)
int pid;
unsigned char magic[2];
xread_all(archive_handle->src_fd, &magic, 2);
/* Cant lseek over pipe's */
archive_handle->seek = seek_by_char;
archive_xread_all(archive_handle, &magic, 2);
if ((magic[0] != 0x1f) || (magic[1] != 0x8b)) {
error_msg_and_die("Invalid gzip magic");
}