From: Jani Nikula Date: Sun, 3 Nov 2013 12:24:42 +0000 (+0200) Subject: [PATCH v2 02/11] lib: construct compactor within try block to catch any exceptions X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c0eb9cefac521cb7789bf32567a36128f4708133;p=notmuch-archives.git [PATCH v2 02/11] lib: construct compactor within try block to catch any exceptions --- diff --git a/94/c4a0d7b2b067a67e6a9e6179c913ad4cbb4300 b/94/c4a0d7b2b067a67e6a9e6179c913ad4cbb4300 new file mode 100644 index 000000000..e72fef7ba --- /dev/null +++ b/94/c4a0d7b2b067a67e6a9e6179c913ad4cbb4300 @@ -0,0 +1,100 @@ +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 A8CF7429E39 + for ; Sun, 3 Nov 2013 04:25:13 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" +X-Spam-Flag: NO +X-Spam-Score: -0.7 +X-Spam-Level: +X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 + tests=[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 hCq9ckAq9qcM for ; + Sun, 3 Nov 2013 04:25:06 -0800 (PST) +Received: from mail-ea0-f181.google.com (mail-ea0-f181.google.com + [209.85.215.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 755AE431FCB + for ; Sun, 3 Nov 2013 04:25:00 -0800 (PST) +Received: by mail-ea0-f181.google.com with SMTP id d10so2908743eaj.12 + for ; Sun, 03 Nov 2013 04:24:59 -0800 (PST) +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20130820; + h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to + :references:in-reply-to:references; + bh=HDt7xBQIHRZ5pkmnXu/Yo5o9jor6sS7ZoHvjffwwkVk=; + b=M7FBzMfeKW9NQMHiQgVI5UvahPOGJ7LVjAJXDj6eC5M1Uiy6w3i/1FyP1W2OgNcVVZ + zzz8bqO4GiXhNNtGvUjWiHfzYOB0YCBSGEL4te4ivxlqUH2IJ2aq8Bjd1GS8i86vYVRO + qiirdKnil6JXfh4fAWvtKRi81GRLimMUNyAt/FbvasYDNpaUj7LxhgEH7YHBVbgzVSNj + N/+0T83GZwHmKiE7S1CHQ6GW9T14a1zj/VDAnsJDIshZ429s0j3yk9PUyp3sqnKvXaqp + zfIhFH55kZoZZlTPotbNMdiYCkHASJjm/SB2ABsrrwIOioQ9xlxZkIKT7j/mR9+7G2tF + 1u+w== +X-Gm-Message-State: + ALoCoQmKOCsezKOkSazSDLRjXeqsNgXal9yAjZx25wDSo2g5ytSuSko72QXaq7VMnsYQ73LJ5qLJ +X-Received: by 10.14.32.196 with SMTP id o44mr2326162eea.43.1383481499294; + Sun, 03 Nov 2013 04:24:59 -0800 (PST) +Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi. + [88.195.111.91]) + by mx.google.com with ESMTPSA id 8sm1246954eem.15.2013.11.03.04.24.57 + for + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Sun, 03 Nov 2013 04:24:58 -0800 (PST) +From: Jani Nikula +To: notmuch@notmuchmail.org +Subject: [PATCH v2 02/11] lib: construct compactor within try block to catch + any exceptions +Date: Sun, 3 Nov 2013 14:24:42 +0200 +Message-Id: + <27c1f09763c60c9ec9791b066756608108e49539.1383481295.git.jani@nikula.org> +X-Mailer: git-send-email 1.8.4.rc3 +In-Reply-To: +References: +In-Reply-To: +References: +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: Sun, 03 Nov 2013 12:25:14 -0000 + +Constructors may also throw exceptions. Catch them. +--- + lib/database.cc | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/lib/database.cc b/lib/database.cc +index 20e5ec2..3dfea0f 100644 +--- a/lib/database.cc ++++ b/lib/database.cc +@@ -864,7 +864,6 @@ notmuch_database_compact (const char* path, + notmuch_compact_status_cb_t status_cb) + { + void *local = talloc_new (NULL); +- NotmuchCompactor compactor(status_cb); + char *notmuch_path, *xapian_path, *compact_xapian_path; + char *old_xapian_path = NULL; + notmuch_status_t ret = NOTMUCH_STATUS_SUCCESS; +@@ -910,6 +909,8 @@ notmuch_database_compact (const char* path, + } + + try { ++ NotmuchCompactor compactor(status_cb); ++ + compactor.set_renumber(false); + compactor.add_source(xapian_path); + compactor.set_destdir(compact_xapian_path); +-- +1.8.4.rc3 +