]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-4289 changed to backup the file with epoch time instead of delete it
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 28 Feb 2013 15:17:46 +0000 (09:17 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Thu, 28 Feb 2013 15:17:46 +0000 (09:17 -0600)
src/switch_core_db.c

index c507c993680c6ce24c4b4f6611c1096fbb1ab3a2..590301fcc5abca8405e59591bdbd69388021442b 100644 (file)
@@ -233,9 +233,11 @@ SWITCH_DECLARE(switch_core_db_t *) switch_core_db_open_file(const char *filename
                if (cb_arg.ok && (1 == cb_arg.rows)) {
                        break;
                } else if (0 == i) {
+                       char *cpath = switch_mprintf("%s.%ld.cdb", path, (long) switch_epoch_time_now(NULL));
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "SQLite integrity_check failed for [%s]. Deleting file and retrying\n", path);
                        switch_core_db_close(db);
-                       remove(path);
+                       rename(path, cpath);
+                       free(cpath);
                        continue;
 
                } else {