summaryrefslogtreecommitdiff
path: root/src/journal
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-06-15 19:09:02 +0200
committerLennart Poettering <lennart@poettering.net>2015-06-15 19:28:55 +0200
commit14bcf25c8b94b5c3556ba3983028a2b35ed0572f (patch)
treed63090263d6927239b0ca3de20d21e5f95a9f878 /src/journal
parenta4c8a5995102144225439c0077bbda5325761986 (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/journal')
-rw-r--r--src/journal/coredump.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/journal/coredump.c b/src/journal/coredump.c
index 1c747aa2b4..62483a2a05 100644
--- a/src/journal/coredump.c
+++ b/src/journal/coredump.c
@@ -301,7 +301,7 @@ static int save_external_coredump(
if (r < 0)
return log_error_errno(r, "Failed to determine coredump file name: %m");
- r = tempfn_random(fn, &tmp);
+ r = tempfn_random(fn, NULL, &tmp);
if (r < 0)
return log_error_errno(r, "Failed to determine temporary file name: %m");
@@ -347,7 +347,7 @@ static int save_external_coredump(
goto uncompressed;
}
- r = tempfn_random(fn_compressed, &tmp_compressed);
+ r = tempfn_random(fn_compressed, NULL, &tmp_compressed);
if (r < 0) {
log_error_errno(r, "Failed to determine temporary file name for %s: %m", fn_compressed);
goto uncompressed;