csync_update: Remove the check for csync_get_statedb_exists

This always returns true since _csync_statedb_is_empty also always
returns true. This function was initially intended to be a shortcut
in case the database doesn't contain any row, but has been broken since
27fb5d9128 and now won't return false
unless the statement fails.

The _last_db_return_error in _csync_detect_update would take care
of that code path in a more direct and clearer way anyway.
This commit is contained in:
Jocelyn Turcotte 2017-09-14 13:30:57 +02:00 committed by Roeland Jago Douma
parent 81e32e1a08
commit 4e90bd7a5a
No known key found for this signature in database
GPG key ID: F941078878347C0C

View file

@ -170,7 +170,6 @@ static int _csync_detect_update(CSYNC *ctx, std::unique_ptr<csync_file_stat_t> f
* renamed, the db gets queried by the inode of the file as that one
* does not change on rename.
*/
if (csync_get_statedb_exists(ctx)) {
tmp = csync_statedb_get_stat_by_path(ctx, fs->path);
if(_last_db_return_error(ctx)) {
@ -341,11 +340,6 @@ static int _csync_detect_update(CSYNC *ctx, std::unique_ptr<csync_file_stat_t> f
}
}
}
} else {
CSYNC_LOG(CSYNC_LOG_PRIORITY_WARN, "Unable to open statedb" );
ctx->status_code = CSYNC_STATUS_UNSUCCESSFUL;
return -1;
}
out: