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:
@@ -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");
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user