Change zck_reset_failed_chunks to void
authorJonathan Dieter <jdieter@gmail.com>
Wed, 6 Jun 2018 06:34:46 +0000 (09:34 +0300)
committerJonathan Dieter <jdieter@gmail.com>
Wed, 6 Jun 2018 06:34:46 +0000 (09:34 +0300)
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
include/zck.h
src/lib/index/index_read.c

index 22d78a9d71b6034268ef2f82eb28598d038731f3..04510f16179a95f42efd26121f07ca7210d7b442 100644 (file)
@@ -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
index 1fc2ccc92e233b61c22b6b126d7235ca9ebfd4cf..e1ea38c98ff119eeefe1be29e7e783f4cedf8ec6 100644 (file)
@@ -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;
 }