]> git.tuebingen.mpg.de Git - dss.git/commitdiff
Merge branch 't/zero-rsync-fix'
authorAndre Noll <maan@systemlinux.org>
Thu, 20 Dec 2012 13:36:42 +0000 (14:36 +0100)
committerAndre Noll <maan@systemlinux.org>
Thu, 20 Dec 2012 13:36:42 +0000 (14:36 +0100)
1  2 
dss.c

diff --combined dss.c
index 258cd3fe862054298f078e6815d152bdd56f162d,354bdb847095d0dd2b6a2346b9bdceaae7977d0d..11c1d06554f9dcb95599fa2a5dc2bd6f9ee21e4b
--- 1/dss.c
--- 2/dss.c
+++ b/dss.c
@@@ -548,10 -548,17 +548,17 @@@ static int rename_incomplete_snapshot(i
  {
        char *old_name;
        int ret;
+       int64_t now;
+       /*
+        * We don't want the dss_rename() below to fail with EEXIST because the
+        * last complete snapshot was created (and completed) in the same
+        * second as this one.
+        */
+       while ((now = get_current_time()) == start)
+               sleep(1);
        free(path_to_last_complete_snapshot);
-       ret = complete_name(start, get_current_time(),
-               &path_to_last_complete_snapshot);
+       ret = complete_name(start, now, &path_to_last_complete_snapshot);
        if (ret < 0)
                return ret;
        old_name = incomplete_name(start);
@@@ -932,9 -939,8 +939,9 @@@ static int check_config(void
                return -E_INVALID_NUMBER;
        }
        DSS_DEBUG_LOG(("unit interval: %i day(s)\n", conf.unit_interval_arg));
 -      if (conf.num_intervals_arg <= 0) {
 -              DSS_ERROR_LOG(("bad number of intervals  %i\n", conf.num_intervals_arg));
 +      if (conf.num_intervals_arg <= 0 || conf.num_intervals_arg > 30) {
 +              DSS_ERROR_LOG(("bad number of intervals: %i\n",
 +                      conf.num_intervals_arg));
                return -E_INVALID_NUMBER;
        }
        DSS_DEBUG_LOG(("number of intervals: %i\n", conf.num_intervals_arg));