"Robert P. J. Day" | 63fc1a9 | 2006-07-02 19:47:05 +0000 | [diff] [blame] | 1 | /* vi: set sw=4 ts=4: */ |
Glenn L McGrath | 95ebf61 | 2001-10-25 14:18:08 +0000 | [diff] [blame] | 2 | /* |
Bernhard Reutner-Fischer | fa939aa | 2006-04-05 16:21:37 +0000 | [diff] [blame] | 3 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. |
Glenn L McGrath | 95ebf61 | 2001-10-25 14:18:08 +0000 | [diff] [blame] | 4 | */ |
| 5 | |
Bernhard Reutner-Fischer | fa939aa | 2006-04-05 16:21:37 +0000 | [diff] [blame] | 6 | #include "libbb.h" |
Denis Vlasenko | 9a7d38f | 2007-05-31 22:42:12 +0000 | [diff] [blame] | 7 | #include "unarchive.h" |
Bernhard Reutner-Fischer | fa939aa | 2006-04-05 16:21:37 +0000 | [diff] [blame] | 8 | |
Denis Vlasenko | 3718832 | 2008-02-16 13:20:56 +0000 | [diff] [blame^] | 9 | /* If we are reading through a pipe, or from stdin then we can't lseek, |
Glenn L McGrath | d09bcec | 2003-11-14 08:26:25 +0000 | [diff] [blame] | 10 | * we must read and discard the data to skip over it. |
Glenn L McGrath | d09bcec | 2003-11-14 08:26:25 +0000 | [diff] [blame] | 11 | */ |
Denis Vlasenko | 3718832 | 2008-02-16 13:20:56 +0000 | [diff] [blame^] | 12 | void seek_by_read(const archive_handle_t *archive_handle, unsigned jump_size) |
Glenn L McGrath | 95ebf61 | 2001-10-25 14:18:08 +0000 | [diff] [blame] | 13 | { |
Denis Vlasenko | 714701c | 2006-12-22 00:21:07 +0000 | [diff] [blame] | 14 | if (jump_size) |
| 15 | bb_copyfd_exact_size(archive_handle->src_fd, -1, jump_size); |
Eric Andersen | 2276d83 | 2002-07-11 11:11:56 +0000 | [diff] [blame] | 16 | } |