--- /dev/null
+Return-Path: <david@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 olra.theworths.org (Postfix) with ESMTP id A9E5F431FC0\r
+ for <notmuch@notmuchmail.org>; Sun, 19 Jan 2014 15:28:39 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+ autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id xpFKmAV41V5a for <notmuch@notmuchmail.org>;\r
+ Sun, 19 Jan 2014 15:28:35 -0800 (PST)\r
+Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155])\r
+ (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 95534431FBD\r
+ for <notmuch@notmuchmail.org>; Sun, 19 Jan 2014 15:28:35 -0800 (PST)\r
+Received: from remotemail by yantan.tethera.net with local (Exim 4.80)\r
+ (envelope-from <david@tethera.net>)\r
+ id 1W51n6-0001pZ-Ez; Sun, 19 Jan 2014 19:28:32 -0400\r
+Received: (nullmailer pid 8058 invoked by uid 1000); Sun, 19 Jan 2014\r
+ 23:28:28 -0000\r
+From: David Bremner <david@tethera.net>\r
+To: Jani Nikula <jani@nikula.org>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH v2] lib: add return status to database close and destroy\r
+In-Reply-To: <1390152046-6509-1-git-send-email-jani@nikula.org>\r
+References: <1390152046-6509-1-git-send-email-jani@nikula.org>\r
+User-Agent: Notmuch/0.17+35~g3b36898 (http://notmuchmail.org) Emacs/24.3.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Sun, 19 Jan 2014 19:28:28 -0400\r
+Message-ID: <87ob37k0v7.fsf@zancas.localnet>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://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: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 19 Jan 2014 23:28:39 -0000\r
+\r
+Jani Nikula <jani@nikula.org> writes:\r
+\r
+> -void\r
+> +notmuch_status_t\r
+> notmuch_database_close (notmuch_database_t *notmuch)\r
+> {\r
+> + notmuch_status_t status = NOTMUCH_STATUS_SUCCESS;\r
+> +\r
+> try {\r
+> if (notmuch->xapian_db != NULL &&\r
+> notmuch->mode == NOTMUCH_DATABASE_MODE_READ_WRITE)\r
+> (static_cast <Xapian::WritableDatabase *> (notmuch->xapian_db))->flush ();\r
+> } catch (const Xapian::Error &error) {\r
+> + status = NOTMUCH_STATUS_XAPIAN_EXCEPTION;\r
+> if (! notmuch->exception_reported) {\r
+\r
+as I mentioned on IRC, I don't really know what this piece of code is\r
+useful for, but that's orthogonal to this patch.\r
+\r
+> -void\r
+> +notmuch_status_t\r
+> notmuch_database_destroy (notmuch_database_t *notmuch)\r
+> {\r
+> - notmuch_database_close (notmuch);\r
+> + notmuch_status_t status;\r
+> +\r
+> + status = notmuch_database_close (notmuch);\r
+> talloc_free (notmuch);\r
+> +\r
+> + return status;\r
+> }\r
+\r
+I guess we're implicitly claiming that talloc_free cannot possibly\r
+return -1 in our use case? perhaps a cast to void and/or a comment would\r
+be suitable.\r
+\r
+> const char *\r
+> diff --git a/lib/notmuch.h b/lib/notmuch.h\r
+> index 02604c5..7ac7118 100644\r
+> --- a/lib/notmuch.h\r
+> +++ b/lib/notmuch.h\r
+> @@ -287,8 +287,16 @@ notmuch_database_open (const char *path,\r
+> *\r
+> * notmuch_database_close can be called multiple times. Later calls\r
+> * have no effect.\r
+\r
+Is it conceivable that the user might wish to retry closing if an\r
+exception occurs? It feels like we ought to have an opinion here.\r
+\r
+No functionality complaints...\r
+\r
+d\r