1 Return-Path: <amthrax@drake.mit.edu>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 8AD80431FBC
\r
6 for <notmuch@notmuchmail.org>; Mon, 27 Feb 2012 07:49:28 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id 13GGVoeR7E+t for <notmuch@notmuchmail.org>;
\r
16 Mon, 27 Feb 2012 07:49:28 -0800 (PST)
\r
17 Received: from dmz-mailsec-scanner-1.mit.edu (DMZ-MAILSEC-SCANNER-1.MIT.EDU
\r
19 by olra.theworths.org (Postfix) with ESMTP id EC3FF431FAE
\r
20 for <notmuch@notmuchmail.org>; Mon, 27 Feb 2012 07:49:27 -0800 (PST)
\r
21 X-AuditID: 1209190c-b7fad6d000000920-f2-4f4ba60796e9
\r
22 Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])
\r
23 by dmz-mailsec-scanner-1.mit.edu (Symantec Messaging Gateway) with SMTP
\r
24 id 31.13.02336.706AB4F4; Mon, 27 Feb 2012 10:49:27 -0500 (EST)
\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])
\r
26 by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id q1RFnQsS006846;
\r
27 Mon, 27 Feb 2012 10:49:26 -0500
\r
28 Received: from drake.mit.edu
\r
29 (209-6-116-242.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com
\r
30 [209.6.116.242]) (authenticated bits=0)
\r
31 (User authenticated as amdragon@ATHENA.MIT.EDU)
\r
32 by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q1RFnPsb003382
\r
33 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);
\r
34 Mon, 27 Feb 2012 10:49:26 -0500 (EST)
\r
35 Received: from amthrax by drake.mit.edu with local (Exim 4.77)
\r
36 (envelope-from <amthrax@drake.mit.edu>)
\r
37 id 1S22pJ-0000N6-8v; Mon, 27 Feb 2012 10:49:25 -0500
\r
38 From: Austin Clements <amdragon@MIT.EDU>
\r
39 To: notmuch@notmuchmail.org
\r
40 Subject: [PATCH 1/3] new: Consistently treat fatal errors as fatal
\r
41 Date: Mon, 27 Feb 2012 10:49:17 -0500
\r
42 Message-Id: <1330357759-1337-2-git-send-email-amdragon@mit.edu>
\r
43 X-Mailer: git-send-email 1.7.7.3
\r
44 In-Reply-To: <1330357759-1337-1-git-send-email-amdragon@mit.edu>
\r
45 References: <1330357759-1337-1-git-send-email-amdragon@mit.edu>
\r
46 X-Brightmail-Tracker:
\r
47 H4sIAAAAAAAAA+NgFtrMIsWRmVeSWpSXmKPExsUixCmqrMu+zNvf4OI1aYvrN2cyOzB6PFt1
\r
48 izmAMYrLJiU1J7MstUjfLoEr48ra7YwFjQIVf/YcZmlgPM7TxcjJISFgIvH/9z1WCFtM4sK9
\r
49 9WxdjFwcQgL7GCXeXmlkgnA2MEr8X3SdBcK5zyRxacd+qLL5jBKH2jsZQfrZBDQktu1fDmaL
\r
50 CEhL7Lw7G2guBwezgJrEny4VkLCwgJPEocc/mUBsFgFViRvP5rKB2LwC9hJPl96HOkNB4tzq
\r
51 c+wgNqeAg8TLNX/BaoSAahadO8M8gZF/ASPDKkbZlNwq3dzEzJzi1GTd4uTEvLzUIl1DvdzM
\r
52 Er3UlNJNjOCwkeTZwfjmoNIhRgEORiUe3qJZ3v5CrIllxZW5hxglOZiURHk9lwCF+JLyUyoz
\r
53 Eosz4otKc1KLDzFKcDArifDqZwPleFMSK6tSi/JhUtIcLErivCpa7/yEBNITS1KzU1MLUotg
\r
54 sjIcHEoSvAJLgRoFi1LTUyvSMnNKENJMHJwgw3mAhpuC1PAWFyTmFmemQ+RPMSpKifOygyQE
\r
55 QBIZpXlwvbC4fsUoDvSKMK8lSBUPMCXAdb8CGswENDiAE2xwSSJCSqqBkUN3ZdKTzSmMetc4
\r
56 dTPnXtK7Zx/2PmC9cOH7eeefG4uw/8v1M7lfVSywaqfja4G55pu3tW15cL5ebG9q2OVF9pkL
\r
57 ZkdMN0/6ejxVv/ixcPAnLtVvXlJsupXbPtlqivx7u3JSXrNCRV3J7TWyEfwfsyq+BHecS3jx
\r
58 VWhBB49Euo3LJoV9jf8PKrEUZyQaajEXFScCAIOewMDGAgAA
\r
59 X-BeenThere: notmuch@notmuchmail.org
\r
60 X-Mailman-Version: 2.1.13
\r
62 List-Id: "Use and development of the notmuch mail system."
\r
63 <notmuch.notmuchmail.org>
\r
64 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
65 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
66 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
67 List-Post: <mailto:notmuch@notmuchmail.org>
\r
68 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
69 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
70 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
71 X-List-Received-Date: Mon, 27 Feb 2012 15:49:28 -0000
\r
73 Previously, fatal errors in add_files_recursive were not treated as
\r
74 fatal by its callers (including itself!) and add_files_recursive
\r
75 sometimes returned errors on non-fatal conditions. This makes
\r
76 add_files_recursive errors consistently fatal and updates all callers
\r
77 to treat them as fatal.
\r
79 notmuch-new.c | 13 ++++++++-----
\r
80 1 files changed, 8 insertions(+), 5 deletions(-)
\r
82 diff --git a/notmuch-new.c b/notmuch-new.c
\r
83 index 4f13535..bd9786a 100644
\r
86 @@ -308,7 +308,6 @@ add_files_recursive (notmuch_database_t *notmuch,
\r
87 if (num_fs_entries == -1) {
\r
88 fprintf (stderr, "Error opening directory %s: %s\n",
\r
89 path, strerror (errno));
\r
90 - ret = NOTMUCH_STATUS_FILE_ERROR;
\r
94 @@ -351,8 +350,10 @@ add_files_recursive (notmuch_database_t *notmuch,
\r
96 next = talloc_asprintf (notmuch, "%s/%s", path, entry->d_name);
\r
97 status = add_files_recursive (notmuch, next, state);
\r
98 - if (status && ret == NOTMUCH_STATUS_SUCCESS)
\r
103 talloc_free (next);
\r
106 @@ -933,6 +934,8 @@ notmuch_new_command (void *ctx, int argc, char *argv[])
\r
109 ret = add_files (notmuch, db_path, &add_files_state);
\r
113 gettimeofday (&tv_start, NULL);
\r
114 for (f = add_files_state.removed_files->head; f && !interrupted; f = f->next) {
\r
115 @@ -965,6 +968,7 @@ notmuch_new_command (void *ctx, int argc, char *argv[])
\r
120 talloc_free (add_files_state.removed_files);
\r
121 talloc_free (add_files_state.removed_directories);
\r
122 talloc_free (add_files_state.directory_mtimes);
\r
123 @@ -1012,10 +1016,9 @@ notmuch_new_command (void *ctx, int argc, char *argv[])
\r
128 - printf ("\nNote: At least one error was encountered: %s\n",
\r
130 + printf ("\nNote: A fatal error was encountered: %s\n",
\r
131 notmuch_status_to_string (ret));
\r
134 notmuch_database_close (notmuch);
\r