From: Kevin McCarthy Date: Wed, 16 Mar 2016 21:15:14 +0000 (-0700) Subject: Fix tcbdb error reporting to use ecode, not errno. X-Git-Tag: neomutt-20160404~52 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2ad5f4b689aaa9e854b5497362adfaad665d1ee6;p=neomutt Fix tcbdb error reporting to use ecode, not errno. After committing aff8d62ebddb and taking a closer look at the tcbdb documentation, I realized those functions don't set errno. Change the error handling messages to instead get the ecode and message using tcbdbecode() and tcbdberrmsg(). --- diff --git a/hcache.c b/hcache.c index 428d8146a..9f3157df0 100644 --- a/hcache.c +++ b/hcache.c @@ -931,7 +931,8 @@ hcache_open_tc (struct header_cache* h, const char* path) return 0; else { - dprint(2, (debugfile, "tcbdbopen failed for %s: %s (errno %d)\n", path, strerror (errno), errno)); + int ecode = tcbdbecode (h->db); + dprint (2, (debugfile, "tcbdbopen failed for %s: %s (ecode %d)\n", path, tcbdberrmsg (ecode), ecode)); tcbdbdel(h->db); return -1; } @@ -944,7 +945,10 @@ mutt_hcache_close(header_cache_t *h) return; if (!tcbdbclose(h->db)) - dprint (2, (debugfile, "tcbdbclose failed for %s: %s (errno %d)\n", h->folder, strerror (errno), errno)); + { + int ecode = tcbdbecode (h->db); + dprint (2, (debugfile, "tcbdbclose failed for %s: %s (ecode %d)\n", h->folder, tcbdberrmsg (ecode), ecode)); + } tcbdbdel(h->db); FREE(&h->folder); FREE(&h);