Improve pack download error handling

Make sure tar extraction errors count towards pack errors, and use the
generic ENOSWUPDSERVER if download retries do not resolve the issue.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
This commit is contained in:
Patrick McCarty
2017-01-24 17:30:42 -08:00
committed by tmarcu
parent f6742d904b
commit 166645aa3b
3 changed files with 8 additions and 2 deletions
+6 -1
View File
@@ -85,7 +85,12 @@ static int download_pack(int oldversion, int newversion, char *module)
fclose(tarfile);
}
return err;
// Only negative return values should indicate errors
if (err > 0) {
return -err;
} else {
return err;
}
}
/* pull in packs for base and any subscription */
+1
View File
@@ -368,6 +368,7 @@ download_packs:
goto download_packs;
}
printf("No network, or server unavailable for pack downloads\n");
ret = ENOSWUPDSERVER;
goto clean_exit;
}
+1 -1
View File
@@ -231,7 +231,7 @@ static int get_all_files(struct manifest *official_manifest, struct list *subs)
* logging needed */
printf("zero pack downloads failed. \n");
printf("Failed - Server-side error, cannot download necessary files\n");
return ret;
return -ENOSWUPDSERVER;
}
iter = list_head(official_manifest->files);
while (iter) {