diff options
Diffstat (limited to 'libsparse')
-rw-r--r-- | libsparse/sparse_read.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/libsparse/sparse_read.c b/libsparse/sparse_read.c index 9b10293fe..ec63850d8 100644 --- a/libsparse/sparse_read.c +++ b/libsparse/sparse_read.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #define _FILE_OFFSET_BITS 64 | 18 | #define _FILE_OFFSET_BITS 64 |
19 | #define _LARGEFILE64_SOURCE 1 | 19 | #define _LARGEFILE64_SOURCE 1 |
20 | 20 | ||
21 | #include <inttypes.h> | ||
21 | #include <fcntl.h> | 22 | #include <fcntl.h> |
22 | #include <stdarg.h> | 23 | #include <stdarg.h> |
23 | #include <stdbool.h> | 24 | #include <stdbool.h> |
@@ -233,7 +234,7 @@ static int process_chunk(struct sparse_file *s, int fd, off64_t offset, | |||
233 | ret = process_raw_chunk(s, chunk_data_size, fd, offset, | 234 | ret = process_raw_chunk(s, chunk_data_size, fd, offset, |
234 | chunk_header->chunk_sz, cur_block, crc_ptr); | 235 | chunk_header->chunk_sz, cur_block, crc_ptr); |
235 | if (ret < 0) { | 236 | if (ret < 0) { |
236 | verbose_error(s->verbose, ret, "data block at %lld", offset); | 237 | verbose_error(s->verbose, ret, "data block at %" PRId64, offset); |
237 | return ret; | 238 | return ret; |
238 | } | 239 | } |
239 | return chunk_header->chunk_sz; | 240 | return chunk_header->chunk_sz; |
@@ -241,7 +242,7 @@ static int process_chunk(struct sparse_file *s, int fd, off64_t offset, | |||
241 | ret = process_fill_chunk(s, chunk_data_size, fd, | 242 | ret = process_fill_chunk(s, chunk_data_size, fd, |
242 | chunk_header->chunk_sz, cur_block, crc_ptr); | 243 | chunk_header->chunk_sz, cur_block, crc_ptr); |
243 | if (ret < 0) { | 244 | if (ret < 0) { |
244 | verbose_error(s->verbose, ret, "fill block at %lld", offset); | 245 | verbose_error(s->verbose, ret, "fill block at %" PRId64, offset); |
245 | return ret; | 246 | return ret; |
246 | } | 247 | } |
247 | return chunk_header->chunk_sz; | 248 | return chunk_header->chunk_sz; |
@@ -250,7 +251,7 @@ static int process_chunk(struct sparse_file *s, int fd, off64_t offset, | |||
250 | chunk_header->chunk_sz, cur_block, crc_ptr); | 251 | chunk_header->chunk_sz, cur_block, crc_ptr); |
251 | if (chunk_data_size != 0) { | 252 | if (chunk_data_size != 0) { |
252 | if (ret < 0) { | 253 | if (ret < 0) { |
253 | verbose_error(s->verbose, ret, "skip block at %lld", offset); | 254 | verbose_error(s->verbose, ret, "skip block at %" PRId64, offset); |
254 | return ret; | 255 | return ret; |
255 | } | 256 | } |
256 | } | 257 | } |
@@ -258,13 +259,13 @@ static int process_chunk(struct sparse_file *s, int fd, off64_t offset, | |||
258 | case CHUNK_TYPE_CRC32: | 259 | case CHUNK_TYPE_CRC32: |
259 | ret = process_crc32_chunk(fd, chunk_data_size, *crc_ptr); | 260 | ret = process_crc32_chunk(fd, chunk_data_size, *crc_ptr); |
260 | if (ret < 0) { | 261 | if (ret < 0) { |
261 | verbose_error(s->verbose, -EINVAL, "crc block at %lld", | 262 | verbose_error(s->verbose, -EINVAL, "crc block at %" PRId64, |
262 | offset); | 263 | offset); |
263 | return ret; | 264 | return ret; |
264 | } | 265 | } |
265 | return 0; | 266 | return 0; |
266 | default: | 267 | default: |
267 | verbose_error(s->verbose, -EINVAL, "unknown block %04X at %lld", | 268 | verbose_error(s->verbose, -EINVAL, "unknown block %04X at %" PRId64, |
268 | chunk_header->chunk_type, offset); | 269 | chunk_header->chunk_type, offset); |
269 | } | 270 | } |
270 | 271 | ||