From: Jonathan Dieter Date: Wed, 6 Jun 2018 06:34:46 +0000 (+0300) Subject: Change zck_reset_failed_chunks to void X-Git-Tag: archive/raspbian/1.1.9+ds1-1+rpi1~1^2~246 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=bfbcc0e96c9fa8b67ee5459f95b554755f3ae526;p=zchunk.git Change zck_reset_failed_chunks to void Signed-off-by: Jonathan Dieter --- diff --git a/include/zck.h b/include/zck.h index 22d78a9..04510f1 100644 --- a/include/zck.h +++ b/include/zck.h @@ -146,6 +146,9 @@ int zck_validate_checksums(zckCtx *zck) /* Validate just the data checksum for the current file */ int zck_validate_data_checksum(zckCtx *zck) __attribute__ ((warn_unused_result)); +/* Go through file and mark valid chunks as valid */ +int zck_find_valid_chunks(zckCtx *zck) + __attribute__ ((warn_unused_result)); /* Get a zckRange of ranges that need to still be downloaded. * max_ranges is the maximum number of ranges supported in a single request @@ -167,8 +170,7 @@ int zck_missing_chunks(zckCtx *zck) int zck_failed_chunks(zckCtx *zck) __attribute__ ((warn_unused_result)); /* Reset failed chunks to become missing */ -int zck_reset_failed_chunks(zckCtx *zck) - __attribute__ ((warn_unused_result)); +void zck_reset_failed_chunks(zckCtx *zck); /******************************************************************* * The functions should be all you need to read and write a zchunk diff --git a/src/lib/index/index_read.c b/src/lib/index/index_read.c index 1fc2ccc..e1ea38c 100644 --- a/src/lib/index/index_read.c +++ b/src/lib/index/index_read.c @@ -132,10 +132,12 @@ int PUBLIC zck_has_failed_chunks(zckCtx *zck) { return failed; } -int PUBLIC zck_reset_failed_chunks(zckCtx *zck) { - VALIDATE(zck); +void PUBLIC zck_reset_failed_chunks(zckCtx *zck) { + if(!zck) + return; + for(zckIndexItem *idx = zck->index.first; idx; idx=idx->next) if(idx->valid == -1) idx->valid = 0; - return True; + return; }