diff options
author | Neelesh Gupta <neelegup@linux.vnet.ibm.com> | 2013-09-12 19:56:54 +0530 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2013-09-25 14:56:50 +0800 |
commit | ce1875fe6d550803879cad4ed168229e154c0d3c (patch) | |
tree | ca0d411d7bd451e3d760a8b0b60f0e33bcea46e5 /discover/paths.h | |
parent | 1972d9cfcc5300cd8cb2f587d9bc5f856322ae8f (diff) | |
download | petitboot-ce1875fe6d550803879cad4ed168229e154c0d3c.zip petitboot-ce1875fe6d550803879cad4ed168229e154c0d3c.tar.gz |
discover: Add an asynchronous version of load_url
A new load_url_async() function handles retrieving the resources by
forking an external process which currently blocks the parent waiting
for the process to complete. This patch modifies the load_*() functions
to handle it asynchronously by providing the exit callback and returning
without waiting for the child process to exit.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com>
Diffstat (limited to 'discover/paths.h')
-rw-r--r-- | discover/paths.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/discover/paths.h b/discover/paths.h index 20a2249..93788e9 100644 --- a/discover/paths.h +++ b/discover/paths.h @@ -16,7 +16,12 @@ char *join_paths(void *alloc_ctx, const char *a, const char *b); */ const char *mount_base(void); +typedef void (*load_url_callback)(void *data, int *status); + /* Load a (potentially remote) file, and return a guaranteed-local name */ +char *load_url_async(void *ctx, struct pb_url *url, unsigned int *tempfile, + load_url_callback url_cb); + char *load_url(void *ctx, struct pb_url *url, unsigned int *tempfile); #endif /* PATHS_H */ |