--- /dev/null
+Return-Path: <bremner@tethera.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id F338C6DE02DD\r
+ for <notmuch@notmuchmail.org>; Fri, 8 Apr 2016 18:50:08 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.02\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.02 tagged_above=-999 required=5 tests=[AWL=-0.009,\r
+ SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id XjAFmJ7AsthO for <notmuch@notmuchmail.org>;\r
+ Fri, 8 Apr 2016 18:49:59 -0700 (PDT)\r
+Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id A20E96DE0173\r
+ for <notmuch@notmuchmail.org>; Fri, 8 Apr 2016 18:49:59 -0700 (PDT)\r
+Received: from remotemail by fethera.tethera.net with local (Exim 4.84)\r
+ (envelope-from <bremner@tethera.net>)\r
+ id 1aoi2J-00022G-Qo; Fri, 08 Apr 2016 21:50:07 -0400\r
+Received: (nullmailer pid 6630 invoked by uid 1000);\r
+ Sat, 09 Apr 2016 01:49:55 -0000\r
+From: David Bremner <david@tethera.net>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 1/4] test: improve error handling in lib-error tests\r
+Date: Fri, 8 Apr 2016 22:49:47 -0300\r
+Message-Id: <1460166590-6526-2-git-send-email-david@tethera.net>\r
+X-Mailer: git-send-email 2.8.0.rc3\r
+In-Reply-To: <1460166590-6526-1-git-send-email-david@tethera.net>\r
+References: <1460166590-6526-1-git-send-email-david@tethera.net>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.20\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sat, 09 Apr 2016 01:50:09 -0000\r
+\r
+There is at least one bug fixed here (missing parameter to printf), even\r
+if exiting via segfault is considered OK.\r
+---\r
+ test/T560-lib-error.sh | 12 ++++++++----\r
+ 1 file changed, 8 insertions(+), 4 deletions(-)\r
+\r
+diff --git a/test/T560-lib-error.sh b/test/T560-lib-error.sh\r
+index 59a479c..49d3674 100755\r
+--- a/test/T560-lib-error.sh\r
++++ b/test/T560-lib-error.sh\r
+@@ -202,16 +202,20 @@ int main (int argc, char** argv)\r
+ notmuch_database_t *db;\r
+ notmuch_status_t stat;\r
+ char *path;\r
++ char *msg = NULL;\r
+ int fd;\r
+ \r
+- stat = notmuch_database_open (argv[1], NOTMUCH_DATABASE_MODE_READ_WRITE, &db);\r
++ stat = notmuch_database_open_verbose (argv[1], NOTMUCH_DATABASE_MODE_READ_WRITE, &db, &msg);\r
+ if (stat != NOTMUCH_STATUS_SUCCESS) {\r
+- fprintf (stderr, "error opening database: %d\n", stat);\r
++ fprintf (stderr, "error opening database: %d %s\n", stat, msg ? msg : "");\r
++ exit (1);\r
+ }\r
+ path = talloc_asprintf (db, "%s/.notmuch/xapian/postlist.DB", argv[1]);\r
+ fd = open(path,O_WRONLY|O_TRUNC);\r
+- if (fd < 0)\r
+- fprintf (stderr, "error opening %s\n");\r
++ if (fd < 0) {\r
++ fprintf (stderr, "error opening %s\n", argv[1]);\r
++ exit (1);\r
++ }\r
+ EOF\r
+ cat <<'EOF' > c_tail\r
+ if (stat) {\r
+-- \r
+2.8.0.rc3\r
+\r