From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id pftjCdm2AV9vKAAA0tVLHw (envelope-from ) for ; Sun, 05 Jul 2020 11:17:45 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id wJrDBNm2AV88FgAA1q6Kng (envelope-from ) for ; Sun, 05 Jul 2020 11:17:45 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [IPv6:2607:5300:201:3100::1657]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 8C21F9403D2 for ; Sun, 5 Jul 2020 11:17:43 +0000 (UTC) Received: from [144.217.243.247] (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 45FFE1FC24; Sun, 5 Jul 2020 07:17:34 -0400 (EDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id 608E81FBFF for ; Sun, 5 Jul 2020 07:17:31 -0400 (EDT) Received: by fethera.tethera.net (Postfix, from userid 1001) id B4286613B0; Sun, 5 Jul 2020 07:17:29 -0400 (EDT) Received: (nullmailer pid 3917422 invoked by uid 1000); Sun, 05 Jul 2020 11:17:28 -0000 From: David Bremner To: Floris Bruynooghe , notmuch@notmuchmail.org Subject: Re: [PATCH 2/4] lib: catch error from closed db in n_m_get_message_id In-Reply-To: <87eeprkxnu.fsf@tethera.net> References: <20200630011411.612552-1-david@tethera.net> <20200630011411.612552-3-david@tethera.net> <87h7unxp1j.fsf@powell.devork.be> <87eeprkxnu.fsf@tethera.net> Date: Sun, 05 Jul 2020 08:17:28 -0300 Message-ID: <87blkuky7r.fsf@tethera.net> MIME-Version: 1.0 Message-ID-Hash: WWEQL6VMSVOMDCGHDIPR6EUAFOAECOXV X-Message-ID-Hash: WWEQL6VMSVOMDCGHDIPR6EUAFOAECOXV X-MailFrom: david@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Spam-Score: 0.53 X-TUID: CbVdzr0Th3kb David Bremner writes: > Floris Bruynooghe writes: > >> notmuch_database_get_version currently returns and unsigned int and >> segfaults on use with a closed db. > > Yes, the ones without a proper status value are going to be a bit work. > > In the next series I just posted [1], I started providing status value > returning version (see notmuch_message_get_flag_st). We've been through > a few of these migrations and it has not been too painful. > I thought of another variation for the boolean valued functions. We could embed the boolean values in the notmuch_status_t value by adding one or more new status values corresponding to TRUE and FALSE. I'm not sure if that would be much simpler, but it would avoid the use of output parameters.