diff --git a/src/packs.c b/src/packs.c index 9158a62d..0f7d0341 100644 --- a/src/packs.c +++ b/src/packs.c @@ -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 */ diff --git a/src/update.c b/src/update.c index cc22242e..fc2766e4 100644 --- a/src/update.c +++ b/src/update.c @@ -368,6 +368,7 @@ download_packs: goto download_packs; } printf("No network, or server unavailable for pack downloads\n"); + ret = ENOSWUPDSERVER; goto clean_exit; } diff --git a/src/verify.c b/src/verify.c index 4fc81baa..522da9a2 100644 --- a/src/verify.c +++ b/src/verify.c @@ -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) {