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>
This commit is contained in:
Stefani Seibold 2009-07-25 02:02:22 +02:00 committed by Denys Vlasenko
parent bac9f03ed8
commit f3b56b428f

View File

@ -208,6 +208,7 @@ static uint32_t read_next_cds(int count_m1, uint32_t cds_offset, cds_header_t *c
static void unzip_skip(off_t skip)
{
if (lseek(zip_fd, skip, SEEK_CUR) == (off_t)-1)
bb_copyfd_exact_size(zip_fd, -1, skip);
}