csync: Move the statedb (journal) to the local directory.

This commit is contained in:
Andreas Schneider 2012-10-22 14:53:59 +02:00
parent 42421cb4cc
commit 76e6fbb72f

View file

@ -246,14 +246,12 @@ int csync_init(CSYNC *ctx) {
/* create/load statedb */ /* create/load statedb */
if (! csync_is_statedb_disabled(ctx)) { if (! csync_is_statedb_disabled(ctx)) {
uint64_t h = csync_create_statedb_hash(ctx); rc = asprintf(&ctx->statedb.file, "%s/.csync_journal.db",
if (asprintf(&ctx->statedb.file, "%s/csync_statedb_%llu.db", ctx->local.uri);
ctx->options.config_dir, (long long unsigned int) h) < 0) { if (rc < 0) {
rc = -1; goto out;
goto out;
} }
CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG, "Remote replica: %s", ctx->remote.uri); CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG, "Journal: %s", ctx->statedb.file);
CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG, "Statedb: %s", ctx->statedb.file);
if (csync_statedb_load(ctx, ctx->statedb.file) < 0) { if (csync_statedb_load(ctx, ctx->statedb.file) < 0) {
rc = -1; rc = -1;