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 CBEB9431FC3 for ; Sat, 21 Apr 2012 21:27:56 -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 jTw53mOJA5rO for ; Sat, 21 Apr 2012 21:27:56 -0700 (PDT) Received: from dmz-mailsec-scanner-7.mit.edu (DMZ-MAILSEC-SCANNER-7.MIT.EDU [18.7.68.36]) by olra.theworths.org (Postfix) with ESMTP id 03826431FAF for ; Sat, 21 Apr 2012 21:27:55 -0700 (PDT) X-AuditID: 12074424-b7fae6d000000906-78-4f9388cb3ab5 Received: from mailhub-auth-4.mit.edu ( [18.7.62.39]) by dmz-mailsec-scanner-7.mit.edu (Symantec Messaging Gateway) with SMTP id 4F.AB.02310.BC8839F4; Sun, 22 Apr 2012 00:27:55 -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 q3M4RtcF019371; Sun, 22 Apr 2012 00:27:55 -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 q3M4Rs5P011066 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Sun, 22 Apr 2012 00:27:54 -0400 (EDT) Received: from amthrax by drake.mit.edu with local (Exim 4.77) (envelope-from ) id 1SLoOw-0003IF-12; Sun, 22 Apr 2012 00:27:54 -0400 From: Austin Clements To: notmuch@notmuchmail.org Subject: [PATCH v2 4/4] new: Fix missing end_atomic in remove_filename on error Date: Sun, 22 Apr 2012 00:27:48 -0400 Message-Id: <1335068868-12593-5-git-send-email-amdragon@mit.edu> X-Mailer: git-send-email 1.7.9.1 In-Reply-To: <1335068868-12593-1-git-send-email-amdragon@mit.edu> References: <1330357759-1337-1-git-send-email-amdragon@mit.edu> <1335068868-12593-1-git-send-email-amdragon@mit.edu> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrMIsWRmVeSWpSXmKPExsUixG6nrnu6Y7K/wbcnshbXb85kdmD0eLbq FnMAYxSXTUpqTmZZapG+XQJXRt/6I6wFRzgqnh95ytbA+Imti5GTQ0LARGLBnAtMELaYxIV7 64HiXBxCAvsYJS5MnM4C4WxglJi7fy+Uc59JYufli6wQznxGic2HtrGD9LMJaEhs27+cEcQW EZCW2Hl3NlARBwezgJrEny4VkLCwgL/EhylzWUBsFgFVidPHnzGD2LwCDhLNW+6xQpyhIPFs 3XGwkzgFHCUWvzwONlJIoEyi6eUyxgmM/AsYGVYxyqbkVunmJmbmFKcm6xYnJ+blpRbpmuvl ZpbopaaUbmIEh42Lyg7G5kNKhxgFOBiVeHhfmUz2F2JNLCuuzD3EKMnBpCTKq18JFOJLyk+p zEgszogvKs1JLT7EKMHBrCTC+1kEKMebklhZlVqUD5OS5mBREufV0HrnJySQnliSmp2aWpBa BJOV4eBQkuBtAMaHkGBRanpqRVpmTglCmomDE2Q4D9Dw5+0gw4sLEnOLM9Mh8qcYFaXEeUVA mgVAEhmleXC9sLh+xSgO9IowbzZIFQ8wJcB1vwIazAQ0OCFmEsjgkkSElFQD42q9jfoP9+1Q ajVKrJz2asUGoR9bev9+t+b5cv55tO3ht9F3tdXezJ2exTPNLiVZ+Ij5+WVR16eKZ2ofddX+ cSj+xyKNzeunB83W//YzR7b4JsunnZMDr4dINxoXCboaM57tUQ6YX8fuOfXMmwsik/Rf3tt9 zGTlCU6WykRe790m+UqR+255HFNiKc5INNRiLipOBABOl5KWxgIAAA== 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 04:27:57 -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 2103b18..9eebea4 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