unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Austin Clements <amdragon@MIT.EDU>
To: Ali Polatel <polatel@gmail.com>, David Bremner <david@tethera.net>
Cc: notmuch@notmuchmail.org
Subject: Re: Concerns regarding some library functions
Date: Tue, 27 Sep 2011 18:46:22 -0400	[thread overview]
Message-ID: <20110927224622.GR17905@mit.edu> (raw)
In-Reply-To: <87fwjhx6p5.fsf@convex-new.cs.unb.ca>

Quoth David Bremner on Sep 27 at  1:59 pm:
> On Tue, 27 Sep 2011 16:25:58 +0300, Ali Polatel <polatel@gmail.com> wrote:
> 
> > The problem with their design is NULL return may both mean an error
> > condition and "message not found". However, we already have a similar
> > function which does not have such a flaw, namely notmuch_database_add_message().
> 
> So, I take there is no way to distinguish those two outcomes? That does
> sound bad. Looking at the code for notmuch-new, it looks like the return
> value of notmuch_database_find_message_by_filename is used without
> checking it for NULL.  Austin, can you comment on that at all?

I'd be happy to distinguish these outcomes.  I did
notmuch_database_find_message_by_filename the way I did only to be
consistent with notmuch_database_find_message.  Since ndfmbf isn't
entrenched yet, now is a good time to change it.

The call in notmuch-new should check the return, though if it can't
find the message at that point, something has gone terribly wrong.
Segfaulting is never the answer, though.

  reply	other threads:[~2011-09-27 22:44 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-27 13:25 Concerns regarding some library functions Ali Polatel
2011-09-27 16:59 ` David Bremner
2011-09-27 22:46   ` Austin Clements [this message]
2011-09-28  7:53     ` Ali Polatel
2011-09-29 14:51       ` Austin Clements
2011-09-29 19:59         ` David Bremner
2011-09-29 20:15           ` Austin Clements
2011-10-04 11:18             ` David Bremner
2011-10-04 13:40               ` Tomi Ollila
2011-10-04 19:36               ` libnotmuch SONAME bumped David Bremner
2011-09-30  6:47         ` Concerns regarding some library functions Ali Polatel
2011-10-01  8:12           ` [PATCH] lib: make find_message{,by_filename) report errors Ali Polatel
2011-10-01  8:12             ` Ali Polatel
2011-10-05 13:42               ` Sebastian Spaeth
2011-10-03 16:49             ` [PATCH v1 0/1] " Ali Polatel
2011-10-03 16:49               ` [PATCH v1 1/1] " Ali Polatel
2011-10-03 17:43                 ` Austin Clements
2011-10-03 20:38                   ` [PATCH v1 1/1] lib: make find_message{, by_filename) " Ali Polatel
2011-10-03 20:40                     ` [PATCH v2 0/2] Better error handling Ali Polatel
2011-10-03 20:40                       ` [PATCH v2 1/2] lib: destroy message object after message removal Ali Polatel
2011-10-03 20:40                       ` [PATCH v2 2/2] lib: make find_message{,by_filename) report errors Ali Polatel
2011-10-03 20:53                       ` [PATCH v2 0/2] Better error handling Ali Polatel
2011-10-03 21:03                       ` Austin Clements
2011-10-04  1:10             ` [PATCH] lib: make find_message{,by_filename) report errors David Bremner
2011-10-04  5:00               ` Ali Polatel
2011-10-04  5:06                 ` [PATCH v3 0/2] Better error handling Ali Polatel
2011-10-04  5:06                   ` [PATCH v3 1/2] lib: destroy message object after message removal Ali Polatel
2011-10-04  5:06                   ` [PATCH v3 2/2] lib: make find_message{,by_filename) report errors Ali Polatel
2011-10-04 10:43                   ` [PATCH v3 0/2] Better error handling David Bremner
2011-09-28 15:42 ` Concerns regarding some library functions Sebastian Spaeth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110927224622.GR17905@mit.edu \
    --to=amdragon@mit.edu \
    --cc=david@tethera.net \
    --cc=notmuch@notmuchmail.org \
    --cc=polatel@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).