From: Karel Zak Date: Wed, 27 Jun 2012 11:14:37 +0000 (+0200) Subject: use notmuch_status_t for DB open X-Git-Tag: neomutt-20160404~13^2~56 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7dd044532292948c4f539cf676f9508e4395efe2;p=neomutt use notmuch_status_t for DB open Signed-off-by: Karel Zak --- diff --git a/mutt_notmuch.c b/mutt_notmuch.c index f4c8cc089..bfbc59d8d 100644 --- a/mutt_notmuch.c +++ b/mutt_notmuch.c @@ -372,13 +372,13 @@ static notmuch_database_t *do_database_open(const char *filename, { notmuch_database_t *db = NULL; unsigned int ct = 0; - int status = 0; + notmuch_status_t st = NOTMUCH_STATUS_SUCCESS; dprint(1, (debugfile, "nm: db open '%s' %s (timeout %d)\n", filename, writable ? "[WRITE]" : "[READ]", NotmuchOpenTimeout)); do { #ifdef NOTMUCH_API_3 - status = notmuch_database_open(filename, + st = notmuch_database_open(filename, writable ? NOTMUCH_DATABASE_MODE_READ_WRITE : NOTMUCH_DATABASE_MODE_READ_ONLY, &db); #else @@ -397,7 +397,10 @@ static notmuch_database_t *do_database_open(const char *filename, if (verbose) { if (!db) - mutt_error (_("Cannot open notmuch database: %s"), filename); + mutt_error (_("Cannot open notmuch database: %s: %s"), + filename, + st ? notmuch_status_to_string(st) : + _("unknown reason")); else if (ct > 1) mutt_clear_error(); }