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:
@@ -8,6 +8,12 @@ int fopen_temporary_at(int dir_fd, const char *path, FILE **ret_file, char **ret
|
||||
static inline int fopen_temporary(const char *path, FILE **ret_file, char **ret_path) {
|
||||
return fopen_temporary_at(AT_FDCWD, path, ret_file, ret_path);
|
||||
}
|
||||
|
||||
int fopen_temporary_child_at(int dir_fd, const char *path, FILE **ret_file, char **ret_path);
|
||||
static inline int fopen_temporary_child(const char *path, FILE **ret_file, char **ret_path) {
|
||||
return fopen_temporary_child_at(AT_FDCWD, path, ret_file, ret_path);
|
||||
}
|
||||
|
||||
int mkostemp_safe(char *pattern);
|
||||
int fmkostemp_safe(char *pattern, const char *mode, FILE**_f);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user