summaryrefslogtreecommitdiffstats
path: root/discover/parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'discover/parser.c')
-rw-r--r--discover/parser.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/discover/parser.c b/discover/parser.c
index 7d9cd0d..a304f0c 100644
--- a/discover/parser.c
+++ b/discover/parser.c
@@ -29,23 +29,22 @@ static char *local_path(struct discover_context *ctx,
static int download_config(struct discover_context *ctx, char **buf, int *len)
{
- unsigned tempfile;
- const char *file;
+ struct load_url_result *result;
int rc;
- file = load_url(ctx, ctx->conf_url, &tempfile);
- if (!file)
+ result = load_url(ctx, ctx->conf_url);
+ if (!result)
return -1;
- rc = read_file(ctx, file, buf, len);
+ rc = read_file(ctx, result->local, buf, len);
if (rc)
goto out_clean;
return 0;
out_clean:
- if (tempfile)
- unlink(file);
+ if (result->cleanup_local)
+ unlink(result->local);
return -1;
}
OpenPOWER on IntegriCloud