summaryrefslogtreecommitdiff
path: root/camel
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2015-07-03 06:17:23 +0200
committerMilan Crha <mcrha@redhat.com>2015-07-03 06:17:23 +0200
commit36f37ab8394fc0d7fd4ff05413bad6f51a36f915 (patch)
treefa691b1d426c76ddaa17f46c5e55a73c6861dd2f /camel
parente30450db6dc20f0c468d0553704a03065a596df6 (diff)
downloadevolution-data-server-36f37ab8394fc0d7fd4ff05413bad6f51a36f915.tar.gz
Bug 751769 - camel_db_maybe_run_maintenance() returns failure incorrectly
Diffstat (limited to 'camel')
-rw-r--r--camel/camel-db.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/camel/camel-db.c b/camel/camel-db.c
index 48cef893d..1105c6210 100644
--- a/camel/camel-db.c
+++ b/camel/camel-db.c
@@ -2777,14 +2777,16 @@ camel_db_maybe_run_maintenance (CamelDB *cdb,
if (cdb_sql_exec (cdb->db, "PRAGMA page_count;", get_number_cb, &page_count, &local_error) == SQLITE_OK &&
cdb_sql_exec (cdb->db, "PRAGMA freelist_count;", get_number_cb, &freelist_count, &local_error) == SQLITE_OK) {
/* Vacuum, if there's more than 5% of the free pages */
- success = !page_count || !freelist_count || (freelist_count * 1000 / page_count > 50 &&
- cdb_sql_exec (cdb->db, "vacuum;", NULL, NULL, &local_error) == SQLITE_OK);
+ success = !page_count || !freelist_count || freelist_count * 1000 / page_count <= 50 ||
+ cdb_sql_exec (cdb->db, "vacuum;", NULL, NULL, &local_error) == SQLITE_OK;
}
cdb_writer_unlock (cdb);
- if (local_error)
+ if (local_error) {
g_propagate_error (error, local_error);
+ success = FALSE;
+ }
return success;
}