Allow newly created database in test.

This commit is contained in:
Klaas Freitag 2013-07-09 17:31:06 +02:00
parent b7d549e5a0
commit 4489eb6cc0

View file

@ -330,7 +330,12 @@ int csync_statedb_close(CSYNC *ctx, const char *statedb, int jwritten) {
* the tmp db.
*/
if (jwritten) {
if (_csync_statedb_check(ctx, statedb_tmp) == 0) {
/* statedb check returns either
* 0 : database exists and is fine
* 1 : new database was set up
* -1 : error.
*/
if (_csync_statedb_check(ctx, statedb_tmp) >= 0) {
/* New statedb is valid. */
/* Move the tmp-db to the real one. */