X-Git-Url: http://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=discover%2Fpaths.c;h=24e978b4e2c1c4b5cfc6092f40adcb6b7cecc8e8;hp=3a69488e3e87e44dcd508a4ac4ba650d4c18571a;hb=dc85de97c79c2172a87fc95cca16e6c6055dc1f4;hpb=aa23987dd043f7c8bea5a48bd9476a4ca1620069 diff --git a/discover/paths.c b/discover/paths.c index 3a69488..24e978b 100644 --- a/discover/paths.c +++ b/discover/paths.c @@ -436,16 +436,18 @@ static void load_wget(struct load_task *task, int flags) */ static void load_local(struct load_task *task) { + struct load_url_result *result = task->result; int rc; rc = access(task->url->path, F_OK); if (rc) { - task->result->status = LOAD_ERROR; + result->status = LOAD_ERROR; } else { - task->result->local = talloc_strdup(task->result, - task->url->path); - task->result->status = LOAD_OK; + result->local = talloc_strdup(task->result, task->url->path); + result->status = LOAD_OK; } + + task->async_cb(task->result, task->async_data); } static void load_url_async_start_pending(struct load_task *task, int flags) @@ -618,7 +620,7 @@ struct load_url_result *load_url_async(void *ctx, struct pb_url *url, return NULL; } - if (!task->async) + if (!task->async || result->status == LOAD_OK) talloc_free(task); return result;