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 32BB2429E34 for ; Sat, 11 Jun 2011 13:05:57 -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 tiqP7Q52KSBw for ; Sat, 11 Jun 2011 13:05:56 -0700 (PDT) Received: from dmz-mailsec-scanner-4.mit.edu (DMZ-MAILSEC-SCANNER-4.MIT.EDU [18.9.25.15]) by olra.theworths.org (Postfix) with ESMTP id 1F57F429E33 for ; Sat, 11 Jun 2011 13:05:56 -0700 (PDT) X-AuditID: 1209190f-b7b0eae000000a42-c1-4df3caa81b34 Received: from mailhub-auth-4.mit.edu ( [18.7.62.39]) by dmz-mailsec-scanner-4.mit.edu (Symantec Messaging Gateway) with SMTP id 46.DC.02626.8AAC3FD4; Sat, 11 Jun 2011 16:06:00 -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 p5BK5tEu029964; Sat, 11 Jun 2011 16:05: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 p5BK5sj7005895 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Sat, 11 Jun 2011 16:05:55 -0400 (EDT) Received: from amthrax by drake.mit.edu with local (Exim 4.76) (envelope-from ) id 1QVURO-0000Hu-BG; Sat, 11 Jun 2011 16:05:54 -0400 From: Austin Clements To: notmuch@notmuchmail.org Subject: [PATCH 05/17] new: Don't lose messages on SIGINT. Date: Sat, 11 Jun 2011 16:04:31 -0400 Message-Id: <1307822683-848-6-git-send-email-amdragon@mit.edu> X-Mailer: git-send-email 1.7.5.1 In-Reply-To: <1307822683-848-1-git-send-email-amdragon@mit.edu> References: <87ei34rnc5.fsf@yoom.home.cworth.org> <1307822683-848-1-git-send-email-amdragon@mit.edu> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrLIsWRmVeSWpSXmKPExsUixG6nrrvi1Gdfg9MN2hbXb85kdmD0eLbq FnMAYxSXTUpqTmZZapG+XQJXxspzW1gKVnBXrHjI18DYxdnFyMkhIWAiMXPyLxYIW0ziwr31 bF2MXBxCAvsYJZaeXMgE4WxglJjZeA7Kuc8k8e9QMwuEM59R4vm8J2wg/WwCGhLb9i9nBLFF BKQldt6dzdrFyMHBLKAm8adLBcQUFrCS2DrTDqSCRUBVYtbtPUwgNq+AncTnD9vYIK5QkLhy ZR7YRZwC9hLzDl4Fs4UE0iSW3NrNPoGRfwEjwypG2ZTcKt3cxMyc4tRk3eLkxLy81CJdE73c zBK91JTSTYygkOGU5N/B+O2g0iFGAQ5GJR5elbWffYVYE8uKK3MPMUpyMCmJ8uqcAArxJeWn VGYkFmfEF5XmpBYfYpTgYFYS4V3f/slXiDclsbIqtSgfJiXNwaIkzjtLUt1XSCA9sSQ1OzW1 ILUIJivDwaEkwbv5JNBQwaLU9NSKtMycEoQ0EwcnyHAeoOFHQWp4iwsSc4sz0yHypxh1OR5v 2HSIUYglLz8vVUqc9z5IkQBIUUZpHtwcWKy/YhQHekuYdxdIFQ8wTcBNegW0hAloiUAp2JKS RISUVANjA8P84IBFyolx7Gvn9qXNvnxhyYYZC/wPmdQdvaD+WK4++2tA5jPFb8IhTWvXnF0V o/ZZSvf8fReHqWqbP65dOkmn/PxFESbvKS49BpbiH5X9AuPlZs+L6uyy72njK1ubpzr7jtO2 r+JHXcOiJE98uCHmsYHfeW8HN1/QuxlycTcqd25cxrVYiaU4I9FQi7moOBEAYFB2TdACAAA= Cc: Austin Clements 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: Sat, 11 Jun 2011 20:05:57 -0000 Previously, message removals were always performed, even after a SIGINT. As a result, when a message was moved from one folder to another, a SIGINT between processing the directory the message was removed from and processing the directory it was added to would result in notmuch removing that message from the database. --- notmuch-new.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/notmuch-new.c b/notmuch-new.c index 744f4ca..6859594 100644 --- a/notmuch-new.c +++ b/notmuch-new.c @@ -841,7 +841,7 @@ notmuch_new_command (void *ctx, int argc, char *argv[]) removed_files = 0; renamed_files = 0; gettimeofday (&tv_start, NULL); - for (f = add_files_state.removed_files->head; f; f = f->next) { + for (f = add_files_state.removed_files->head; f && !interrupted; f = f->next) { status = notmuch_database_remove_message (notmuch, f->filename); if (status == NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID) renamed_files++; @@ -856,7 +856,7 @@ notmuch_new_command (void *ctx, int argc, char *argv[]) } gettimeofday (&tv_start, NULL); - for (f = add_files_state.removed_directories->head, i = 0; f; f = f->next, i++) { + for (f = add_files_state.removed_directories->head, i = 0; f && !interrupted; f = f->next, i++) { _remove_directory (ctx, notmuch, f->filename, &renamed_files, &removed_files); if (do_print_progress) { -- 1.7.5.1