tmpfile-util: turn last parameter of link_tmpfile() into a proper flags

This changes a boolean param into a proper bitflag field.

Given this only defines a single flag for now this doesn't look like
much of an improvement. But we'll add another flag shortly, where it
starts to make more sense.
This commit is contained in:
Lennart Poettering
2023-06-13 09:40:53 +02:00
parent 0f85a0d38f
commit 27e18c23bc
8 changed files with 24 additions and 19 deletions
+1 -1
View File
@@ -1465,7 +1465,7 @@ int copy_file_atomic_at_full(
return -errno;
}
r = link_tmpfile_at(fdt, dir_fdt, t, to, copy_flags & COPY_REPLACE);
r = link_tmpfile_at(fdt, dir_fdt, t, to, (copy_flags & COPY_REPLACE) ? LINK_TMPFILE_REPLACE : 0);
if (r < 0)
return r;
+1 -1
View File
@@ -408,7 +408,7 @@ static int trie_store(struct trie *trie, const char *filename, bool compat) {
return -errno;
fwrite(&h, sizeof(struct trie_header_f), 1, f);
r = flink_tmpfile(f, filename_tmp, filename, /* replace= */ true);
r = flink_tmpfile(f, filename_tmp, filename, LINK_TMPFILE_REPLACE);
if (r < 0)
return r;