summaryrefslogtreecommitdiff
path: root/src/shared/copy.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-06-15 19:09:02 +0200
committerSven Eden <yamakuzure@gmx.net>2017-03-14 10:03:00 +0100
commite7fadef378f4f0df0925aca2f5c062d0b02c343a (patch)
tree63d0c41bce34089f33601430096035dd92fefa2b /src/shared/copy.c
parent435ef7bdc398a2c0ecd8a5f8b8be304c51a9e212 (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/shared/copy.c')
-rw-r--r--src/shared/copy.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/shared/copy.c b/src/shared/copy.c
index 1282cb88b..230e7e4d3 100644
--- a/src/shared/copy.c
+++ b/src/shared/copy.c
@@ -396,7 +396,7 @@ int copy_file_atomic(const char *from, const char *to, mode_t mode, bool replace
assert(from);
assert(to);
- r = tempfn_random(to, &t);
+ r = tempfn_random(to, NULL, &t);
if (r < 0)
return r;