mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
Makes a backup copy of the content file.
Before overwriting the existing content file, rename it adding the .backup extension, but only if such content file was read and validated.
This commit is contained in:
parent
68042d528d
commit
da08ca4497
8 changed files with 49 additions and 16 deletions
|
|
@ -298,6 +298,16 @@ int filter_content(tommy_list* contentlist, const char* path)
|
|||
pathprint(tmp, sizeof(tmp), "%s.tmp", content->content);
|
||||
if (pathcmp(tmp, path) == 0)
|
||||
return -1;
|
||||
|
||||
/* exclude also the ".backup" copy */
|
||||
pathprint(tmp, sizeof(tmp), "%s.backup", content->content);
|
||||
if (pathcmp(tmp, path) == 0)
|
||||
return -1;
|
||||
|
||||
/* exclude also the ".lock" file */
|
||||
pathprint(tmp, sizeof(tmp), "%s.lock", content->content);
|
||||
if (pathcmp(tmp, path) == 0)
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue