summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2013-04-20 23:55:16 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2013-04-20 23:55:16 +0200
commitdc9fa15a48ef572a4bd26e9449a65c59d1d495ce (patch)
tree7750de3f46463762166ebb54573a9ab66fd6025b /src
parentc8431881e0cb8fb022ee496ee555c7658a2a5e0d (diff)
downloadfastd-dc9fa15a48ef572a4bd26e9449a65c59d1d495ce.tar
fastd-dc9fa15a48ef572a4bd26e9449a65c59d1d495ce.zip
Ignore backup files
Diffstat (limited to 'src')
-rw-r--r--src/config.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/config.c b/src/config.c
index cf95fb7..b042f95 100644
--- a/src/config.c
+++ b/src/config.c
@@ -132,7 +132,7 @@ static bool config_match(const char *opt, ...) {
va_list ap;
bool match = false;
const char *str;
-
+
va_start(ap, opt);
while((str = va_arg(ap, const char*)) != NULL) {
@@ -351,6 +351,11 @@ static void read_peer_dir(fastd_context_t *ctx, fastd_config_t *conf, const char
if (result->d_name[0] == '.')
continue;
+ if (result->d_name[strlen(result->d_name)-1] == '~') {
+ pr_verbose(ctx, "ignoring file `%s' as it seems to be a backup file", result->d_name);
+ continue;
+ }
+
struct stat statbuf;
if (stat(result->d_name, &statbuf)) {
pr_warn(ctx, "ignoring file `%s': stat failed: %s", result->d_name, strerror(errno));