[Pkg-owncloud-commits] [owncloud-client] 24/115: csync statedb: Fixed handling of sqlite reply value.
Sandro Knauß
hefee-guest at moszumanska.debian.org
Fri Aug 29 22:03:56 UTC 2014
This is an automated email from the git hooks/post-receive script.
hefee-guest pushed a commit to branch master
in repository owncloud-client.
commit 73325bcd4142fb25607a9cb7c9503e9a9f4432dc
Author: Klaas Freitag <freitag at owncloud.com>
Date: Thu Aug 14 11:05:49 2014 +0200
csync statedb: Fixed handling of sqlite reply value.
---
csync/src/csync_statedb.c | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/csync/src/csync_statedb.c b/csync/src/csync_statedb.c
index 8780915..d04c2d2 100644
--- a/csync/src/csync_statedb.c
+++ b/csync/src/csync_statedb.c
@@ -322,6 +322,10 @@ static int _csync_file_stat_from_metadata_table( csync_file_stat_t **st, sqlite3
REMOTE_PERM_BUF_SIZE);
}
}
+ } else {
+ if( rc != SQLITE_DONE ) {
+ CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG, "WARN: Query results in %d", rc);
+ }
}
return rc;
}
@@ -353,8 +357,9 @@ csync_file_stat_t *csync_statedb_get_stat_by_hash(CSYNC *ctx,
sqlite3_bind_int64(ctx->statedb.by_hash_stmt, 1, (long long signed int)phash);
- if( _csync_file_stat_from_metadata_table(&st, ctx->statedb.by_hash_stmt) < 0 ) {
- CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "WRN: Could not get line from metadata!");
+ rc = _csync_file_stat_from_metadata_table(&st, ctx->statedb.by_hash_stmt);
+ if( !(rc == SQLITE_ROW || rc == SQLITE_DONE) ) {
+ CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "WRN: Could not get line from metadata: %d!", rc);
}
sqlite3_reset(ctx->statedb.by_hash_stmt);
@@ -390,8 +395,9 @@ csync_file_stat_t *csync_statedb_get_stat_by_file_id(CSYNC *ctx,
/* bind the query value */
sqlite3_bind_text(ctx->statedb.by_fileid_stmt, 1, file_id, -1, SQLITE_STATIC);
- if( _csync_file_stat_from_metadata_table(&st, ctx->statedb.by_fileid_stmt) < 0 ) {
- CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "WRN: Could not get line from metadata!");
+ rc = _csync_file_stat_from_metadata_table(&st, ctx->statedb.by_fileid_stmt);
+ if( !(rc == SQLITE_ROW || rc == SQLITE_DONE) ) {
+ CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "WRN: Could not get line from metadata: %d!", rc);
}
// clear the resources used by the statement.
sqlite3_reset(ctx->statedb.by_fileid_stmt);
@@ -430,8 +436,9 @@ csync_file_stat_t *csync_statedb_get_stat_by_inode(CSYNC *ctx,
sqlite3_bind_int64(ctx->statedb.by_inode_stmt, 1, (long long signed int)inode);
- if( _csync_file_stat_from_metadata_table(&st, ctx->statedb.by_inode_stmt) < 0 ) {
- CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "WRN: Could not get line from metadata by inode!");
+ rc = _csync_file_stat_from_metadata_table(&st, ctx->statedb.by_inode_stmt);
+ if( !(rc == SQLITE_ROW || rc == SQLITE_DONE) ) {
+ CSYNC_LOG(CSYNC_LOG_PRIORITY_ERROR, "WRN: Could not get line from metadata by inode: %d!", rc);
}
sqlite3_reset(ctx->statedb.by_inode_stmt);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git
More information about the Pkg-owncloud-commits
mailing list