blob: 1f2b805711a917e677975a685ed39be1d17a4079 [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 Vlasenko37188322008-02-16 13:20:56 +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 Vlasenko37188322008-02-16 13:20:56 +000012void seek_by_read(const archive_handle_t *archive_handle, unsigned 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}