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 A4BCA431FD0 for ; Fri, 1 Nov 2013 07:27:38 -0700 (PDT) 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 Aw7yuZKubvAJ for ; Fri, 1 Nov 2013 07:27:34 -0700 (PDT) Received: from mail-ea0-f173.google.com (mail-ea0-f173.google.com [209.85.215.173]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 40F66431FB6 for ; Fri, 1 Nov 2013 07:27:34 -0700 (PDT) Received: by mail-ea0-f173.google.com with SMTP id g10so2090283eak.4 for ; Fri, 01 Nov 2013 07:27:33 -0700 (PDT) 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=emoBs7dLghtavfpAy7YxN20nFqQiC0CKb9juHaSjdOs=; b=QjYtP5PS5lhDgsrZDuS+g+eZh95619OPq6kuZrttazvmrUBF4SKo4eCyrJUYD8kG+R /LZSlJrEBO/iGEnq4tpAvKdEv0cEtSDEX1RgCWLu+vT9l7OfSODDF3VCuwLsdd6oPU5D AaGMBWEAEzBuu35S02Yxq9z5CS20Ciw+sGZORDfQ7lO9etchYjLghCzJs7HYurqABHul VcaE8fJfPpDnJ988+BnmRU2NL4r4BGjkh+OkYvK+JIfpYZ76EM3LuB1bna3HHOQwvhfy xIvls3leu3RBGiE0g+N4ZANyQ1m8/4efMdgJ/3FUB3hq+xdALkDfIyhQ5z3A08hsapQ2 H7Ag== X-Gm-Message-State: ALoCoQmaMA89uu8WeirCdvSdgXJLCddrNAfOoc7Ko9Eym6HX1RPUvMhj42+SwufoqEjN8l6Jvj2/ X-Received: by 10.15.33.198 with SMTP id c46mr117965eev.115.1383316053166; Fri, 01 Nov 2013 07:27:33 -0700 (PDT) Received: from localhost ([2001:4b98:dc0:43:216:3eff:fe1b:25f3]) by mx.google.com with ESMTPSA id w6sm8341181eeo.12.2013.11.01.07.27.31 for (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Fri, 01 Nov 2013 07:27:32 -0700 (PDT) From: Jani Nikula To: notmuch@notmuchmail.org Subject: [PATCH 1/6] lib: construct compactor within try block to catch any exceptions Date: Fri, 1 Nov 2013 15:27:10 +0100 Message-Id: <3812f697da88a2d4ad90e899484b99723c803ec7.1383315568.git.jani@nikula.org> X-Mailer: git-send-email 1.7.2.5 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: Fri, 01 Nov 2013 14:27:38 -0000 Constructors may also throw exceptions. Catch them. --- lib/database.cc | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) 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.7.2.5