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