From e7fadef378f4f0df0925aca2f5c062d0b02c343a Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 15 Jun 2015 19:09:02 +0200 Subject: 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. --- src/shared/machine-pool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/shared/machine-pool.c') diff --git a/src/shared/machine-pool.c b/src/shared/machine-pool.c index 8c64908b1..8af78f47d 100644 --- a/src/shared/machine-pool.c +++ b/src/shared/machine-pool.c @@ -75,7 +75,7 @@ static int setup_machine_raw(uint64_t size, sd_bus_error *error) { if (errno != ENOENT) return sd_bus_error_set_errnof(error, errno, "Failed to open /var/lib/machines.raw: %m"); - r = tempfn_xxxxxx("/var/lib/machines.raw", &tmp); + r = tempfn_xxxxxx("/var/lib/machines.raw", NULL, &tmp); if (r < 0) return r; -- cgit v1.2.3