tmpfile-util: add new LINK_TMPFILE_SYNC flag for syncing properly before/after linking in the file

This syncs the data before linking it in, and both data + dir once done.
This should give us proper semantics for installing files safely into
the fs.
This commit is contained in:
Lennart Poettering
2023-06-13 09:45:39 +02:00
parent 27e18c23bc
commit ce67bf366f
2 changed files with 38 additions and 24 deletions
+1
View File
@@ -32,6 +32,7 @@ int fopen_tmpfile_linkable(const char *target, int flags, char **ret_path, FILE
typedef enum LinkTmpfileFlags {
LINK_TMPFILE_REPLACE = 1 << 0,
LINK_TMPFILE_SYNC = 1 << 1,
} LinkTmpfileFlags;
int link_tmpfile_at(int fd, int dir_fd, const char *path, const char *target, LinkTmpfileFlags flags);