[PATCH v2 05/10] ruby: handle return status of database close
authorPeter Wang <novalazy@gmail.com>
Wed, 16 Apr 2014 12:59:20 +0000 (22:59 +1000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 18:01:39 +0000 (10:01 -0800)
55/beda4d17a07d750b4c9ad306eaf6114cacf7e8 [new file with mode: 0644]

diff --git a/55/beda4d17a07d750b4c9ad306eaf6114cacf7e8 b/55/beda4d17a07d750b4c9ad306eaf6114cacf7e8
new file mode 100644 (file)
index 0000000..eb9632c
--- /dev/null
@@ -0,0 +1,89 @@
+Return-Path: <novalazy@gmail.com>\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 30A37431FDF\r
+       for <notmuch@notmuchmail.org>; Wed, 16 Apr 2014 06:00:36 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.799\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] 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 hYVotLvjUQpD for <notmuch@notmuchmail.org>;\r
+       Wed, 16 Apr 2014 06:00:31 -0700 (PDT)\r
+Received: from mail-pb0-f45.google.com (mail-pb0-f45.google.com\r
+       [209.85.160.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 4425F431FC3\r
+       for <notmuch@notmuchmail.org>; Wed, 16 Apr 2014 06:00:04 -0700 (PDT)\r
+Received: by mail-pb0-f45.google.com with SMTP id uo5so10857388pbc.32\r
+       for <notmuch@notmuchmail.org>; Wed, 16 Apr 2014 06:00:03 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=from:to:cc:subject:date:message-id:in-reply-to:references;\r
+       bh=WeZluKs7E6JIW5mp7eXSpjsvbr9qaRVVzX0ecvdBx1M=;\r
+       b=KLyVaXJ9evOWznxjRIl+XI2M2GNFrC1HfZo2uxnQa++/a0KYKxi/1fZU226SclX0nf\r
+       k7Xr4a6cjzTMwnmrd5SIvw3kpk0HzLZp+pFl+X3falQNdXFsNqERCS86Gxm2QPUCYdhb\r
+       e5Xb/1EU7WOtOyzVCzcDZ2HBwfdyCS0q6KJ7rSQgDv5juDgY6Lqx6nIe8rUztUAy9cTO\r
+       YClYSDe8ydxTmPBzY3uWy9glA8UFMMv/R3ohD+HRdW3sS+U5SCMsSGMezMhEQIVm6mMl\r
+       rPNOnRSMZyJ3zgkpJ4fNIo/3/tIxKNUJnkHH4aqmzsIvVCk23LTiATJHVdPbJllt8GVb\r
+       Y4tQ==\r
+X-Received: by 10.68.220.137 with SMTP id pw9mr8449922pbc.24.1397653203552;\r
+       Wed, 16 Apr 2014 06:00:03 -0700 (PDT)\r
+Received: from localhost (215.42.233.220.static.exetel.com.au.\r
+       [220.233.42.215]) by mx.google.com with ESMTPSA id\r
+       te2sm110970365pac.25.2014.04.16.06.00.01 for <multiple recipients>\r
+       (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+       Wed, 16 Apr 2014 06:00:03 -0700 (PDT)\r
+From: Peter Wang <novalazy@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v2 05/10] ruby: handle return status of database close\r
+Date: Wed, 16 Apr 2014 22:59:20 +1000\r
+Message-Id: <1397653165-15620-6-git-send-email-novalazy@gmail.com>\r
+X-Mailer: git-send-email 1.8.4\r
+In-Reply-To: <1397653165-15620-1-git-send-email-novalazy@gmail.com>\r
+References: <1397653165-15620-1-git-send-email-novalazy@gmail.com>\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: Wed, 16 Apr 2014 13:00:36 -0000\r
+\r
+Throw an exception if notmuch_database_destroy fails.\r
+---\r
+ bindings/ruby/database.c | 4 +++-\r
+ 1 file changed, 3 insertions(+), 1 deletion(-)\r
+\r
+diff --git a/bindings/ruby/database.c b/bindings/ruby/database.c\r
+index e84f726..c03d701 100644\r
+--- a/bindings/ruby/database.c\r
++++ b/bindings/ruby/database.c\r
+@@ -113,11 +113,13 @@ notmuch_rb_database_open (int argc, VALUE *argv, VALUE klass)\r
+ VALUE\r
+ notmuch_rb_database_close (VALUE self)\r
+ {\r
++    notmuch_status_t ret;\r
+     notmuch_database_t *db;\r
\r
+     Data_Get_Notmuch_Database (self, db);\r
+-    notmuch_database_destroy (db);\r
++    ret = notmuch_database_destroy (db);\r
+     DATA_PTR (self) = NULL;\r
++    notmuch_rb_status_raise (ret);\r
\r
+     return Qnil;\r
+ }\r
+-- \r
+1.8.4\r
+\r