tmpfile-util: Introduce fopen_temporary_child()

Instead of having fopen_temporary() create the file either next
to an existing file or in tmp/, let's split this up clearly into
two different functions, one for creating temporary files next to
existing files, and one for creating a temporary file in a directory.
This commit is contained in:
Daan De Meyer
2022-11-17 14:14:31 +01:00
parent 305dd91adf
commit dd3c825294
7 changed files with 62 additions and 26 deletions
+1 -1
View File
@@ -254,7 +254,7 @@ static int make_protofile(const char *root, char **ret) {
assert(ret);
r = fopen_temporary(NULL, &f, &p);
r = fopen_temporary_child(NULL, &f, &p);
if (r < 0)
return log_error_errno(r, "Failed to open temporary file: %m");
+2
View File
@@ -14,6 +14,8 @@ int fopen_temporary_label(
int r;
assert(path);
r = mac_selinux_create_file_prepare(target, S_IFREG);
if (r < 0)
return r;