mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-25 05:45:42 +03:00
statedb: Log an error if we can't open the database.
This commit is contained in:
parent
b43f6690d5
commit
0179c2249d
1 changed files with 4 additions and 2 deletions
|
@ -50,7 +50,7 @@ int csync_get_statedb_exists(CSYNC *ctx) {
|
|||
}
|
||||
|
||||
static int _csync_statedb_check(CSYNC *ctx, const char *statedb) {
|
||||
int fd = -1;
|
||||
int fd = -1, rc;
|
||||
ssize_t r;
|
||||
char buf[BUF_SIZE] = {0};
|
||||
sqlite3 *db = NULL;
|
||||
|
@ -83,10 +83,12 @@ static int _csync_statedb_check(CSYNC *ctx, const char *statedb) {
|
|||
}
|
||||
|
||||
/* create database */
|
||||
if (sqlite3_open(statedb, &db) == SQLITE_OK) {
|
||||
rc = sqlite3_open(statedb, &db);
|
||||
if (rc == SQLITE_OK) {
|
||||
sqlite3_close(db);
|
||||
return 0;
|
||||
}
|
||||
CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "%s %s", sqlite3_errmsg(db), statedb);
|
||||
sqlite3_close(db);
|
||||
|
||||
return -1;
|
||||
|
|
Loading…
Reference in a new issue