From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 5AFE9431FB6 for ; Sun, 22 Apr 2012 08:51:00 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org 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 xa6cSWzGXZZj for ; Sun, 22 Apr 2012 08:50:59 -0700 (PDT) Received: from dmz-mailsec-scanner-2.mit.edu (DMZ-MAILSEC-SCANNER-2.MIT.EDU [18.9.25.13]) by olra.theworths.org (Postfix) with ESMTP id E2E2A431FAE for ; Sun, 22 Apr 2012 08:50:58 -0700 (PDT) X-AuditID: 1209190d-b7fbf6d0000008ba-a0-4f9428e2cf72 Received: from mailhub-auth-4.mit.edu ( [18.7.62.39]) by dmz-mailsec-scanner-2.mit.edu (Symantec Messaging Gateway) with SMTP id EE.83.02234.2E8249F4; Sun, 22 Apr 2012 11:50:58 -0400 (EDT) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id q3MFovEf023025; Sun, 22 Apr 2012 11:50:57 -0400 Received: from drake.mit.edu (209-6-116-242.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com [209.6.116.242]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q3MFou5B003695 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Sun, 22 Apr 2012 11:50:57 -0400 (EDT) Received: from amthrax by drake.mit.edu with local (Exim 4.77) (envelope-from ) id 1SLz3w-0002fJ-Ni; Sun, 22 Apr 2012 11:50:56 -0400 From: Austin Clements To: notmuch@notmuchmail.org Subject: [PATCH v3 4/4] new: Fix missing end_atomic in remove_filename on error Date: Sun, 22 Apr 2012 11:50:52 -0400 Message-Id: <1335109852-10150-5-git-send-email-amdragon@mit.edu> X-Mailer: git-send-email 1.7.9.1 In-Reply-To: <1335109852-10150-1-git-send-email-amdragon@mit.edu> References: <1330357759-1337-1-git-send-email-amdragon@mit.edu> <1335109852-10150-1-git-send-email-amdragon@mit.edu> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrMIsWRmVeSWpSXmKPExsUixG6nrvtIY4q/wbYOHYvrN2cyOzB6PFt1 izmAMYrLJiU1J7MstUjfLoErY8LfR4wFRzgqjr/7y9rA+Imti5GTQ0LAROLPm81QtpjEhXvr gWwuDiGBfYwSh198gHI2MErMWv6RGcK5zyRx+vVmKGc+o8TGFRfZQfrZBDQktu1fzghiiwhI S+y8O5u1i5GDg1lATeJPlwpIWFjAX2LP7WawEhYBVYn+9p2sIDavgIPE2jU9rBBnKEg8W3ec CcTmFHCU+PhuJZgtJFAm8W3eW/YJjPwLGBlWMcqm5Fbp5iZm5hSnJusWJyfm5aUW6Rrp5WaW 6KWmlG5iBIUNpyTvDsZ3B5UOMQpwMCrx8L40mewvxJpYVlyZe4hRkoNJSZTXTW2KvxBfUn5K ZUZicUZ8UWlOavEhRgkOZiUR3s8iQOW8KYmVValF+TApaQ4WJXFeVa13fkIC6YklqdmpqQWp RTBZGQ4OJQlec2B8CAkWpaanVqRl5pQgpJk4OEGG8wANtwap4S0uSMwtzkyHyJ9iVJQS51UG SQiAJDJK8+B6YXH9ilEc6BVh3hCQKh5gSoDrfgU0mAlocELMJJDBJYkIKakGxuvLOSUnLTXW LH8tVp4x9X3cNdETC2SjNl9d3xpbmqBxzeZNh+zubdqGijf2VbIbdKxb+DnvweJH+svdn15V V/uUybjU9NqcNIff/lck1r69u5/bxdeIt2xRfEdDybSCA5lJC5n2TTGe+e/n3/T0j/6q/pOn emzOFT4dt69SKP3NzLtHn/8y+K/EUpyRaKjFXFScCACwV9RzxgIAAA== 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, 22 Apr 2012 15:51:00 -0000 Previously, if we failed to find the message by filename in remove_filename, we would return immediately from the function without ending its atomic block. Now this code follows the usual goto DONE idiom to perform cleanup. --- notmuch-new.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/notmuch-new.c b/notmuch-new.c index bf9b120..473201e 100644 --- a/notmuch-new.c +++ b/notmuch-new.c @@ -779,7 +779,8 @@ remove_filename (notmuch_database_t *notmuch, return status; status = notmuch_database_find_message_by_filename (notmuch, path, &message); if (status || message == NULL) - return status; + goto DONE; + status = notmuch_database_remove_message (notmuch, path); if (status == NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID) { add_files_state->renamed_messages++; @@ -790,6 +791,8 @@ remove_filename (notmuch_database_t *notmuch, add_files_state->removed_messages++; } notmuch_message_destroy (message); + + DONE: notmuch_database_end_atomic (notmuch); return status; } -- 1.7.9.1