blob: 452d82d10b2f220d8e0a1e319c8e6f81ca9b68ca [file] [log] [blame]
"Robert P. J. Day"63fc1a92006-07-02 19:47:05 +00001/* vi: set sw=4 ts=4: */
Glenn L McGrath95ebf612001-10-25 14:18:08 +00002/*
Bernhard Reutner-Fischerfa939aa2006-04-05 16:21:37 +00003 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
Glenn L McGrath95ebf612001-10-25 14:18:08 +00004 */
5
Bernhard Reutner-Fischerfa939aa2006-04-05 16:21:37 +00006#include "libbb.h"
Denis Vlasenko9a7d38f2007-05-31 22:42:12 +00007#include "unarchive.h"
Bernhard Reutner-Fischerfa939aa2006-04-05 16:21:37 +00008
Denis Vlasenkoe1a0d482006-10-20 13:28:22 +00009/* If we are reading through a pipe(), or from stdin then we can't lseek,
Glenn L McGrathd09bcec2003-11-14 08:26:25 +000010 * we must read and discard the data to skip over it.
Glenn L McGrathd09bcec2003-11-14 08:26:25 +000011 */
Denis Vlasenko13858992006-10-08 12:49:22 +000012void seek_by_read(const archive_handle_t *archive_handle, const unsigned int jump_size)
Glenn L McGrath95ebf612001-10-25 14:18:08 +000013{
Denis Vlasenko714701c2006-12-22 00:21:07 +000014 if (jump_size)
15 bb_copyfd_exact_size(archive_handle->src_fd, -1, jump_size);
Eric Andersen2276d832002-07-11 11:11:56 +000016}