From: Anthony Minessale Date: Thu, 28 Feb 2013 15:17:46 +0000 (-0600) Subject: FS-4289 changed to backup the file with epoch time instead of delete it X-Git-Tag: v1.3.13~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1b8ef1842e46387f10d9590e0ff1fd985887ba56;p=thirdparty%2Ffreeswitch.git FS-4289 changed to backup the file with epoch time instead of delete it --- diff --git a/src/switch_core_db.c b/src/switch_core_db.c index c507c99368..590301fcc5 100644 --- a/src/switch_core_db.c +++ b/src/switch_core_db.c @@ -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 {