diff options
Diffstat (limited to 'libsparse/sparse_read.c')
-rw-r--r-- | libsparse/sparse_read.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/libsparse/sparse_read.c b/libsparse/sparse_read.c index 704bcfa..8e188e9 100644 --- a/libsparse/sparse_read.c +++ b/libsparse/sparse_read.c @@ -29,6 +29,8 @@ #include <sparse/sparse.h> +#include "defs.h" +#include "output_file.h" #include "sparse_crc32.h" #include "sparse_file.h" #include "sparse_format.h" @@ -175,24 +177,19 @@ static int process_fill_chunk(struct sparse_file *s, unsigned int chunk_size, } static int process_skip_chunk(struct sparse_file *s, unsigned int chunk_size, - int fd, unsigned int blocks, unsigned int block, uint32_t *crc32) + int fd __unused, unsigned int blocks, + unsigned int block __unused, uint32_t *crc32) { - int ret; - int chunk; - int64_t len = (int64_t)blocks * s->block_size; - uint32_t fill_val; - uint32_t *fillbuf; - unsigned int i; - if (chunk_size != 0) { return -EINVAL; } if (crc32) { + int64_t len = (int64_t)blocks * s->block_size; memset(copybuf, 0, COPY_BUF_SIZE); while (len) { - chunk = min(len, COPY_BUF_SIZE); + int chunk = min(len, COPY_BUF_SIZE); *crc32 = sparse_crc32(*crc32, copybuf, chunk); len -= chunk; } @@ -364,7 +361,6 @@ static int sparse_file_read_normal(struct sparse_file *s, int fd) int64_t remain = s->len; int64_t offset = 0; unsigned int to_read; - char *ptr; unsigned int i; bool sparse_block; |