mirror of
https://github.com/amadvance/snapraid.git
synced 2026-12-05 06:10:13 -05:00
Improve crash resilience in Linux
Syncing the directory is a required step to ensure resilience. Also create the temporary file with O_EXCL to ensure to don't use a stale copy that may link to the original copy.
This commit is contained in:
parent
c696c56df1
commit
473819467f
5 changed files with 87 additions and 6 deletions
|
|
@ -41,6 +41,7 @@ void test(void)
|
|||
s = sopen_multi_write(STREAM_MAX);
|
||||
for (i = 0; i < STREAM_MAX; ++i) {
|
||||
snprintf(file, sizeof(file), "stream%u.bin", i);
|
||||
remove(file);
|
||||
if (sopen_multi_file(s, i, file) != 0) {
|
||||
/* LCOV_EXCL_START */
|
||||
exit(EXIT_FAILURE);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue