X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=discover%2Fparser.c;h=a304f0c989e32f4e124d1f62647547b067d952b5;hb=b201464a18c990ea6df0f2878e532618d4936c53;hp=7d9cd0d4f439487f7907f872efd6a019c1f27378;hpb=2ea5eb23b027519372dd20fbe8f958c06ac2aa6c;p=petitboot 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; }