X-Git-Url: http://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=discover%2Fparser.c;h=a304f0c989e32f4e124d1f62647547b067d952b5;hp=6896075ed1742b82b4e9306a5b1072556c8463df;hb=58dd7a044cdbbb2deba5c45032f166304bd234ff;hpb=a70807730ef59efc4116556ecabe1b9f70ce605b diff --git a/discover/parser.c b/discover/parser.c index 6896075..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; } @@ -125,6 +124,8 @@ void __register_parser(struct parser *parser) { struct p_item* i = talloc(NULL, struct p_item); + printf("%s: %s\n", __func__, parser->name); + i->parser = parser; list_add(&parsers, &i->list); }