Re: [PATCH 1/6] lib/cli: Make notmuch_database_open return a status code

Subject: Re: [PATCH 1/6] lib/cli: Make notmuch_database_open return a status code

Date: Mon, 30 Apr 2012 08:39:32 -0300

To: Austin Clements, notmuch@notmuchmail.org

Cc:

From: David Bremner


I have two questions, both of which might have been settled previously.

>  
> -    return notmuch;
> +    *database = notmuch;
> +    return status;
>  }

Should we check database is non-NULL here?

> diff --git a/notmuch-count.c b/notmuch-count.c
> index 9c2ad7b..2f98128 100644
> --- a/notmuch-count.c
> +++ b/notmuch-count.c

> +    if (notmuch_database_open (notmuch_config_get_database_path (config),
> +			       NOTMUCH_DATABASE_MODE_READ_ONLY, &notmuch))

Is it OK to rely on NOTMUCH_STATUS_SUCCESS==0 ?

d

Thread: