diff --git a/src/bundle.c b/src/bundle.c index 40c787f8..ccc415fb 100644 --- a/src/bundle.c +++ b/src/bundle.c @@ -36,10 +36,6 @@ #define MODE_RW_O (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) -#define add_sub_ERR 1 -#define add_sub_NEW 2 -#define add_sub_BADNAME 4 - /* * list_installable_bundles() * Parse the full manifest for the current version of the OS and print diff --git a/src/swupd.h b/src/swupd.h index 4e97e05e..a80d6e3b 100644 --- a/src/swupd.h +++ b/src/swupd.h @@ -51,6 +51,11 @@ extern "C" { #define DEFAULT_CONTENTURL "https://cdn.download.clearlinux.org/update/" +/* Return codes for adding subscriptions */ +#define add_sub_ERR 1 +#define add_sub_NEW 2 +#define add_sub_BADNAME 4 + struct sub { /* name of bundle/component/subscription */ char *component; diff --git a/src/update.c b/src/update.c index 9ec9d3c8..0f069f70 100644 --- a/src/update.c +++ b/src/update.c @@ -162,10 +162,10 @@ int add_included_manifests(struct manifest *mom, int current, struct list **subs /* Pass the current version here, not the new, otherwise we will never * hit the Manifest delta path. */ - if (add_subscriptions(subbed, subs, current, mom, false, 0) >= 0) { - ret = 0; - } else { + if (add_subscriptions(subbed, subs, current, mom, false, 0) & (add_sub_ERR | add_sub_BADNAME)) { ret = -1; + } else { + ret = 0; } list_free_list(subbed);