diff options
author | Stefani Seibold <stefani@seibold.net> | 2009-07-25 02:02:22 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-07-25 02:02:22 +0200 |
commit | f3b56b428f5c903ef4622d7e04925d9056f751e9 (patch) | |
tree | b5f7b8ca33c30cb8f9ed0d46451ea68f80bae460 | |
parent | bac9f03ed85cb0a6887a8a7e9508e043edb792e8 (diff) | |
download | busybox-f3b56b428f5c903ef4622d7e04925d9056f751e9.tar.gz |
unzip: try lseek before resorting to reading
function old new delta
unzip_skip 16 43 +27
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | archival/unzip.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/archival/unzip.c b/archival/unzip.c index 7b47a8ab8..4201d1dd2 100644 --- a/archival/unzip.c +++ b/archival/unzip.c @@ -208,7 +208,8 @@ static uint32_t read_next_cds(int count_m1, uint32_t cds_offset, cds_header_t *c static void unzip_skip(off_t skip) { - bb_copyfd_exact_size(zip_fd, -1, skip); + if (lseek(zip_fd, skip, SEEK_CUR) == (off_t)-1) + bb_copyfd_exact_size(zip_fd, -1, skip); } static void unzip_create_leading_dirs(const char *fn) |