diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-06-15 19:09:02 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-06-15 19:28:55 +0200 |
commit | 14bcf25c8b94b5c3556ba3983028a2b35ed0572f (patch) | |
tree | d63090263d6927239b0ca3de20d21e5f95a9f878 /src/import/pull-raw.c | |
parent | a4c8a5995102144225439c0077bbda5325761986 (diff) |
util: when creating temporary file names, allow including extra id string in it
This adds a "char *extra" parameter to tempfn_xxxxxx(), tempfn_random(),
tempfn_ranomd_child(). If non-NULL this string is included in the middle
of the newly created file name. This is useful for being able to
distuingish the kind of temporary file when we see one.
This also adds tests for the three call.
For now, we don't make use of this at all, but port all users over.
Diffstat (limited to 'src/import/pull-raw.c')
-rw-r--r-- | src/import/pull-raw.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/import/pull-raw.c b/src/import/pull-raw.c index b65bb0c034..5bfaf012c0 100644 --- a/src/import/pull-raw.c +++ b/src/import/pull-raw.c @@ -208,7 +208,7 @@ static int raw_pull_maybe_convert_qcow2(RawPull *i) { return 0; /* This is a QCOW2 image, let's convert it */ - r = tempfn_random(i->final_path, &t); + r = tempfn_random(i->final_path, NULL, &t); if (r < 0) return log_oom(); @@ -280,7 +280,7 @@ static int raw_pull_make_local_copy(RawPull *i) { if (i->force_local) (void) rm_rf(p, REMOVE_ROOT|REMOVE_PHYSICAL|REMOVE_SUBVOLUME); - r = tempfn_random(p, &tp); + r = tempfn_random(p, NULL, &tp); if (r < 0) return log_oom(); @@ -424,7 +424,7 @@ static int raw_pull_job_on_open_disk(PullJob *j) { if (r < 0) return log_oom(); - r = tempfn_random(i->final_path, &i->temp_path); + r = tempfn_random(i->final_path, NULL, &i->temp_path); if (r < 0) return log_oom(); |