tree-wide: fix use of flink_tmpfile()

Let's always make sure the temporary file returned by fopen_tmpfile()
and friends is removed on failure (via _cleanup_). Conversely, make sure
that once the file is renamed into its final place, we no longer try to
remove the temporary file (since it's not going to exist anymore).
This commit is contained in:
Lennart Poettering
2025-05-16 08:28:42 +02:00
committed by Daan De Meyer
parent b9df3d6447
commit 22b5ddb90f
5 changed files with 14 additions and 1 deletions
+2
View File
@@ -409,6 +409,8 @@ static int trie_store(struct trie *trie, const char *filename, bool compat) {
if (r < 0)
return r;
filename_tmp = mfree(filename_tmp);
/* write succeeded */
log_debug("=== trie on-disk ===");