1 Return-Path: <amdragon@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 78F9D431FAF
\r
6 for <notmuch@notmuchmail.org>; Mon, 30 Apr 2012 09:15:59 -0700 (PDT)
\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 RDtS0EQ3-y4s for <notmuch@notmuchmail.org>;
\r
16 Mon, 30 Apr 2012 09:15:59 -0700 (PDT)
\r
17 Received: from dmz-mailsec-scanner-8.mit.edu (DMZ-MAILSEC-SCANNER-8.MIT.EDU
\r
19 by olra.theworths.org (Postfix) with ESMTP id EE3F2431FAE
\r
20 for <notmuch@notmuchmail.org>; Mon, 30 Apr 2012 09:15:58 -0700 (PDT)
\r
21 X-AuditID: 12074425-b7f4a6d0000008e0-f0-4f9ebabdedec
\r
22 Received: from mailhub-auth-3.mit.edu ( [18.9.21.43])
\r
23 by dmz-mailsec-scanner-8.mit.edu (Symantec Messaging Gateway) with SMTP
\r
24 id 24.E4.02272.DBABE9F4; Mon, 30 Apr 2012 12:15:57 -0400 (EDT)
\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])
\r
26 by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id q3UGFuU3028222;
\r
27 Mon, 30 Apr 2012 12:15:57 -0400
\r
28 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])
\r
29 (authenticated bits=0)
\r
30 (User authenticated as amdragon@ATHENA.MIT.EDU)
\r
31 by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q3UGFtpH002164
\r
32 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);
\r
33 Mon, 30 Apr 2012 12:15:56 -0400 (EDT)
\r
34 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)
\r
35 (envelope-from <amdragon@MIT.EDU>)
\r
36 id 1SOtGV-000718-Ag; Mon, 30 Apr 2012 12:15:55 -0400
\r
37 Date: Mon, 30 Apr 2012 12:15:55 -0400
\r
38 From: Austin Clements <amdragon@MIT.EDU>
\r
39 To: David Bremner <david@tethera.net>
\r
40 Subject: Re: [PATCH 1/6] lib/cli: Make notmuch_database_open return a status
\r
42 Message-ID: <20120430161555.GP2704@mit.edu>
\r
43 References: <1335651473-19652-1-git-send-email-amdragon@mit.edu>
\r
44 <1335651473-19652-2-git-send-email-amdragon@mit.edu>
\r
45 <87pqapphxn.fsf@zancas.localnet>
\r
47 Content-Type: text/plain; charset=us-ascii
\r
48 Content-Disposition: inline
\r
49 In-Reply-To: <87pqapphxn.fsf@zancas.localnet>
\r
50 User-Agent: Mutt/1.5.21 (2010-09-15)
\r
51 X-Brightmail-Tracker:
\r
52 H4sIAAAAAAAAA+NgFmplleLIzCtJLcpLzFFi42IR4hTV1t27a56/wYqTxhY3WrsZLa7fnMns
\r
53 wOTxbNUtZo8th94zBzBFcdmkpOZklqUW6dslcGXsvHiBveAjW8Wx7WvZGxgXsXYxcnJICJhI
\r
54 7H7wnQnCFpO4cG89WxcjF4eQwD5Gib3bjkM5GxglFj/tZ4FwTjJJHL+6gwnCWcIocePQAxaQ
\r
55 fhYBVYmXPZ3sIDabgIbEtv3LGUFsEaD41W2T2UBsZgFpiW+/m8H2CQsES0xYMxfM5hXQlti0
\r
56 7inU0FlAu6+cYYRICEqcnPmEBaJZS+LGv5dARRxgg5b/4wAJcwroSrRcfc4MYosKqEhMObmN
\r
57 bQKj0Cwk3bOQdM9C6F7AyLyKUTYlt0o3NzEzpzg1Wbc4OTEvL7VI10IvN7NELzWldBMjKLTZ
\r
58 XVR3ME44pHSIUYCDUYmHd9L8ef5CrIllxZW5hxglOZiURHlNdwCF+JLyUyozEosz4otKc1KL
\r
59 DzFKcDArifCWTgTK8aYkVlalFuXDpKQ5WJTEeTW13vkJCaQnlqRmp6YWpBbBZGU4OJQkeB/u
\r
60 BGoULEpNT61Iy8wpQUgzcXCCDOcBGv4cpIa3uCAxtzgzHSJ/ilFRSpz3IEhCACSRUZoH1wtL
\r
61 Pa8YxYFeEebdDVLFA0xbcN2vgAYzAQ3ONwcbXJKIkJJqYDwVXZFv/7VW0+l9KO+duJIvWte2
\r
62 O36vn/mTt0qnb9LB22aXn8Q+Nze6dOHs/+eB8lmPhS9or37upLUpiM+CIzLp7Dcdc8PII7Ms
\r
63 A9w53u8I5O8xkgrx/32qdsKHtI70M31bYi8mtfElPl7pKbFN+mKLTk2T93z9lBm6ebnh03qf
\r
64 s/B7TsrpVWIpzkg01GIuKk4EAF5h5uQYAwAA
\r
65 Cc: notmuch@notmuchmail.org
\r
66 X-BeenThere: notmuch@notmuchmail.org
\r
67 X-Mailman-Version: 2.1.13
\r
69 List-Id: "Use and development of the notmuch mail system."
\r
70 <notmuch.notmuchmail.org>
\r
71 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
72 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
73 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
74 List-Post: <mailto:notmuch@notmuchmail.org>
\r
75 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
76 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
77 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
78 X-List-Received-Date: Mon, 30 Apr 2012 16:15:59 -0000
\r
80 Quoth David Bremner on Apr 30 at 8:39 am:
\r
82 > I have two questions, both of which might have been settled previously.
\r
85 > > - return notmuch;
\r
86 > > + *database = notmuch;
\r
87 > > + return status;
\r
90 > Should we check database is non-NULL here?
\r
92 Sure, why not. Since one could now imagine using these functions to
\r
93 create a database without using it or test if a database exists, I
\r
94 made them handle a NULL pointer gracefully.
\r
96 > > diff --git a/notmuch-count.c b/notmuch-count.c
\r
97 > > index 9c2ad7b..2f98128 100644
\r
98 > > --- a/notmuch-count.c
\r
99 > > +++ b/notmuch-count.c
\r
101 > > + if (notmuch_database_open (notmuch_config_get_database_path (config),
\r
102 > > + NOTMUCH_DATABASE_MODE_READ_ONLY, ¬much))
\r
104 > Is it OK to rely on NOTMUCH_STATUS_SUCCESS==0 ?
\r
106 I decree it so. Plus, we already do this sort of thing all over the
\r