diff options
author | Geoff Levand <geoffrey.levand@am.sony.com> | 2009-07-09 14:45:48 -0700 |
---|---|---|
committer | Geoff Levand <geoffrey.levand@am.sony.com> | 2009-07-09 15:54:21 -0700 |
commit | c763f15030565eef2e8b28fdf471ef3e7dd9b933 (patch) | |
tree | 59eb24a1a696e075f362325eee5b23dbaefadc01 /ui/common/loader.c | |
parent | 93b2c2e0f0ca46d2a823b33cdfa44d082e9e8d10 (diff) | |
download | talos-petitboot-c763f15030565eef2e8b28fdf471ef3e7dd9b933.tar.gz talos-petitboot-c763f15030565eef2e8b28fdf471ef3e7dd9b933.zip |
Delete kexec temporary files before rebooting
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Diffstat (limited to 'ui/common/loader.c')
-rw-r--r-- | ui/common/loader.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/ui/common/loader.c b/ui/common/loader.c index 0fe62a0..5c69533 100644 --- a/ui/common/loader.c +++ b/ui/common/loader.c @@ -263,16 +263,22 @@ fail: /** * pb_load_file - Loads a remote file and returns the local file path. * @ctx: The talloc context to associate with the returned string. + * @remote: The remote file URL. + * @tempfile: An optional variable pointer to be set when a temporary local + * file is created. * * Returns the local file path in a talloc'ed character string on success, * or NULL on error. */ -char *pb_load_file(void *ctx, const char *remote) +char *pb_load_file(void *ctx, const char *remote, unsigned int *tempfile) { char *local; struct pb_url *url = pb_url_parse(NULL, remote); + if (tempfile) + *tempfile = 0; + if (!url) return NULL; @@ -280,19 +286,28 @@ char *pb_load_file(void *ctx, const char *remote) case pb_url_ftp: case pb_url_http: local = pb_load_wget(ctx, url, 0); + if (tempfile && local) + *tempfile = 1; break; case pb_url_https: - local = pb_load_wget(ctx, url, - wget_no_check_certificate); + local = pb_load_wget(ctx, url, wget_no_check_certificate); + if (tempfile && local) + *tempfile = 1; break; case pb_url_nfs: local = pb_load_nfs(ctx, url); + if (tempfile && local) + *tempfile = 1; break; case pb_url_sftp: local = pb_load_sftp(ctx, url); + if (tempfile && local) + *tempfile = 1; break; case pb_url_tftp: local = pb_load_tftp(ctx, url); + if (tempfile && local) + *tempfile = 1; break; default: local = talloc_strdup(ctx, url->full); |