X-Git-Url: http://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=discover%2Fparser.c;h=462d614a5c1abeae1866a79f3748428fc956e9ec;hp=1f3674d3ee461cc24fac0f9ca5a8fc11d765fb1c;hb=5be946cda7b8e2271ade6188ca3f5dc068826619;hpb=06a49ebdfc795a70b938f5aee29f3c488ef9fc21 diff --git a/discover/parser.c b/discover/parser.c index 1f3674d..462d614 100644 --- a/discover/parser.c +++ b/discover/parser.c @@ -77,12 +77,17 @@ err_close: return -1; } +static char *local_path(struct discover_context *ctx, + const char *filename) +{ + return join_paths(ctx, ctx->device->mount_path, filename); +} + static void iterate_parser_files(struct discover_context *ctx, const struct parser *parser) { const char * const *filename; - const char *path, *url; - unsigned int tempfile; + const char *path; if (!parser->filenames) return; @@ -91,12 +96,7 @@ static void iterate_parser_files(struct discover_context *ctx, int rc, len; char *buf; - url = resolve_path(ctx, *filename, ctx->device->device_path); - if (!url) - continue; - - path = load_file(ctx, url, &tempfile); - + path = local_path(ctx, *filename); if (!path) continue; @@ -105,12 +105,7 @@ static void iterate_parser_files(struct discover_context *ctx, parser->parse(ctx, buf, len); talloc_free(buf); } - - if (tempfile) - unlink(path); - } - } void iterate_parsers(struct discover_context *ctx)