3rd-party: Fixing some error handling problems on 3rd_party repo

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
This commit is contained in:
Otavio Pontes
2020-03-06 16:58:14 -08:00
parent b6dc104462
commit 126fff4e0d
+7 -4
View File
@@ -71,6 +71,12 @@ static bool parse_key_values(char *section, char *key, char *value, void *data)
struct repo *repo;
struct list **repos = data;
if (!section) {
// 3rd party doesn't have any key to be set outside of a section
// Ignoring it
return true;
}
repo = list_search(*repos, section, cmp_repo_name_string);
if (!repo) {
repo = calloc(1, sizeof(struct repo));
@@ -147,6 +153,7 @@ int third_party_add_repo(const char *repo_name, const char *repo_url)
fp = fopen(repo_config_file, "a");
if (!fp) {
ret = -errno;
goto exit;
}
// write name
@@ -185,10 +192,6 @@ static int write_repo(FILE *fp, struct repo *repo)
}
}
if (ret) {
return ret;
}
return 0;
}