From 35fb2085dc5cd6d3af99ec2f6864c428a574e65c Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Sat, 28 Jun 2014 12:12:51 +0200 Subject: [PATCH] Removes unused code. --- cmdline/elem.c | 7 ------- cmdline/state.c | 19 ------------------- 2 files changed, 26 deletions(-) diff --git a/cmdline/elem.c b/cmdline/elem.c index da0e1ca8..3651aeb4 100644 --- a/cmdline/elem.c +++ b/cmdline/elem.c @@ -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) diff --git a/cmdline/state.c b/cmdline/state.c index 0a6a31de..d5e32cd5 100644 --- a/cmdline/state.c +++ b/cmdline/state.c @@ -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) {