Removes unused code.

This commit is contained in:
Andrea Mazzoleni 2014-06-28 12:12:51 +02:00
parent 3caa251d83
commit 35fb2085dc
2 changed files with 0 additions and 26 deletions

View file

@ -299,13 +299,6 @@ int filter_content(tommy_list* contentlist, const char* path)
if (pathcmp(tmp, path) == 0)
return -1;
#if USE_BACKUP
/* exclude also the ".backup" copy */
pathprint(tmp, sizeof(tmp), "%s.backup", content->content);
if (pathcmp(tmp, path) == 0)
return -1;
#endif
/* exclude also the ".lock" file */
pathprint(tmp, sizeof(tmp), "%s.lock", content->content);
if (pathcmp(tmp, path) == 0)

View file

@ -4150,25 +4150,6 @@ void state_write(struct snapraid_state* state)
struct snapraid_content* content = i->data;
char tmp[PATH_MAX];
#ifdef USE_BACKUP
char backup[PATH_MAX];
/* if the content file was checked reading it, it's a good candidate */
/* to be renamed as backup copy */
if (state->checked_read) {
pathprint(backup, sizeof(backup), "%s.backup", content->content);
if (rename(content->content, backup) != 0) {
/* ignore the error for not existing */
if (errno != ENOENT) {
/* LCOV_EXCL_START */
fprintf(stderr, "Error renaming the content file '%s' to '%s' in rename(). %s.\n", content->content, backup, strerror(errno));
exit(EXIT_FAILURE);
/* LCOV_EXCL_STOP */
}
}
}
#endif
/* now renames the just written copy with the correct name */
pathprint(tmp, sizeof(tmp), "%s.tmp", content->content);
if (rename(tmp, content->content) != 0) {