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 QMMYL8EkBl8sTgAA0tVLHw (envelope-from ) for ; Wed, 08 Jul 2020 19:55: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 0CvyKsEkBl8QNwAA1q6Kng (envelope-from ) for ; Wed, 08 Jul 2020 19:55:45 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [144.217.243.247]) (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 D6444940308 for ; Wed, 8 Jul 2020 19:55:44 +0000 (UTC) Received: from [144.217.243.247] (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 54C571FAE3; Wed, 8 Jul 2020 15:55:39 -0400 (EDT) Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) by mail.notmuchmail.org (Postfix) with ESMTPS id 4C4091F70F for ; Wed, 8 Jul 2020 15:55:36 -0400 (EDT) Received: by mail-ed1-x542.google.com with SMTP id d15so42860315edm.10 for ; Wed, 08 Jul 2020 12:55:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:in-reply-to:references:date:message-id :mime-version; bh=HqtU6UgXDJaWnTgGebRMKEMk0Wzu+1ueSgXrRbLkZyM=; b=DLqdzvyOpyIztxIorxAb8budl4/14w3dEV3SyJOq0DhO+4w2Nlg2Bm+2lJM6/dHlM3 +zAr/s3UnDtMoT34pt6ZyD0kTSlLl/sHe4oPzl7yxhThpZx8wr/1M0BT+7GqIdY9rqDy oPBAWA7KBC7mVYzEzHJqdwBpV0srWSTBbo2CW7tJ9O3dLI9QI6gbnX2aBmtV49El7YJB 34mUeF3l8mtMh8/TfcmkCYE59VlpYPZl2lNiQEwcQDeG6aPOQNQEylaIzA/PJYE3rrNh aZU09pXo5s1v2UuJNNofJiQwwqmVUQJxiJ3JjfmhJADDEwxexb6rZrJ9Sjdr6hovVj0C xkEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:in-reply-to:references :date:message-id:mime-version; bh=HqtU6UgXDJaWnTgGebRMKEMk0Wzu+1ueSgXrRbLkZyM=; b=ehnTbMiHb/NCTKswfvLqBNogX0mWejCKkrZJ0eGelX5C2BVGTJ9p12JIc0MZkXTYB0 n6Rxluybis7LFewKuQzsoHjEdazNwQAZrb/trbJL/WAgo9oHEQdcb5VV62Y6Ab+Tmbqs v1POZTYQOHgEGuMvDTC4iAYSuFTJnWclYAvsD0/mEjPUZEKXwWplFzrfd12TiEZ0ToRb JuwWPSllQchxXIZE5F6eatur8j1ySCOfBM2m06aEYM5N2tdg5Xg3dbWRKVvNakPGfv72 oaHGPqLJ8aTAeHPwdUoq1L9JweJtkwUnWHC36rr+A55/QL7ar1pEW+9IMtMMkC73stYz aEuA== X-Gm-Message-State: AOAM530NMG8mSB44tGYZB2dP5Oj18du6eHDAzVv6+xw00DOi0lzWW3ap Z2EpVZxaG1yLOJP5eJvDDno= X-Google-Smtp-Source: ABdhPJyM/Qle3r8hY0dxTOAanoKvTfkxTZQjqE+dhDnnNxhqQs2B2SGYiodKvIjrWFra5Vvrs7DNmQ== X-Received: by 2002:a05:6402:31ad:: with SMTP id dj13mr25849656edb.88.1594238128313; Wed, 08 Jul 2020 12:55:28 -0700 (PDT) Received: from powell.devork.be (2a02-8388-8480-1180-4c18-fc69-8d8c-22b5.cable.dynamic.v6.surfer.at. [2a02:8388:8480:1180:4c18:fc69:8d8c:22b5]) by smtp.gmail.com with ESMTPSA id ck6sm379514edb.18.2020.07.08.12.55.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jul 2020 12:55:27 -0700 (PDT) Sender: Floris Bruynooghe Received: (nullmailer pid 114845 invoked by uid 1000); Wed, 08 Jul 2020 19:55:26 -0000 From: Floris Bruynooghe To: David Bremner , notmuch@notmuchmail.org Subject: Re: [PATCH 2/4] lib: catch error from closed db in n_m_get_message_id In-Reply-To: <87blkuky7r.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> <87blkuky7r.fsf@tethera.net> Date: Wed, 08 Jul 2020 21:55:26 +0200 Message-ID: <87zh89bx3l.fsf@powell.devork.be> MIME-Version: 1.0 Message-ID-Hash: OOYBJVW5EC3UT73XBUL26SB2X5XHXG3S X-Message-ID-Hash: OOYBJVW5EC3UT73XBUL26SB2X5XHXG3S X-MailFrom: floris.bruynooghe@gmail.com 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=fail (body hash did not verify) header.d=gmail.com header.s=20161025 header.b=DLqdzvyO; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Spam-Score: 1.53 X-TUID: ngSS7Olb6JsS On Sun 05 Jul 2020 at 08:17 -0300, David Bremner wrote: > 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. This also seems very reasonable.