mirror of
https://github.com/clearlinux/swupd-client.git
synced 2026-10-03 23:38:25 +00:00
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:
+6
-1
@@ -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 */
|
||||
|
||||
@@ -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
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user