(NOTMUCH_FEATURE_FILE_TERMS | NOTMUCH_FEATURE_BOOL_FOLDER |
NOTMUCH_FEATURE_LAST_MOD)) {
query = notmuch_query_create (notmuch, "");
- total += notmuch_query_count_messages (query);
+ unsigned msg_count;
+
+ status = notmuch_query_count_messages_st (query, &msg_count);
+ if (status)
+ goto DONE;
+
+ total += msg_count;
notmuch_query_destroy (query);
+ query = NULL;
}
if (new_features & NOTMUCH_FEATURE_DIRECTORY_DOCS) {
t_end = db->allterms_end ("XTIMESTAMP");
query = notmuch_query_create (notmuch, "");
- /* XXX: this should use the _st version, but needs an error
- path */
- for (messages = notmuch_query_search_messages (query);
+ status = notmuch_query_search_messages_st (query, &messages);
+ if (status)
+ goto DONE;
+ for (;
notmuch_messages_valid (messages);
notmuch_messages_move_to_next (messages))
{
}
notmuch_query_destroy (query);
+ query = NULL;
}
/* Perform per-directory upgrades. */
sigaction (SIGALRM, &action, NULL);
}
+ if (query)
+ notmuch_query_destroy (query);
+
talloc_free (local);
return status;
}