Use semaphore locking to avoid starting dss multiple times.
[dss.git] / snap.c
diff --git a/snap.c b/snap.c
index 89d6004b6cb1731a73583d0d4ac07b469b3db916..41dc3296531001d88e9beb709b66c47d2fd2090d 100644 (file)
--- a/snap.c
+++ b/snap.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2008-2010 Andre Noll <maan@systemlinux.org>
  *
  * Licensed under the GPL v2. For licencing details see COPYING.
  */
@@ -101,7 +101,7 @@ static int is_snapshot(const char *dirname, int64_t now, int unit_interval,
        free(tmp);
        if (ret < 0)
                return 0;
-       if (num > now)
+       if (num > now || num < s->creation_time)
                return 0;
        s->completion_time = num;
        s->flags = SS_COMPLETE;