unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] notmuch-deliver: Update to new notmuch_database_open API
@ 2012-06-01 14:16 Austin Clements
  2012-06-01 14:34 ` David Bremner
  0 siblings, 1 reply; 2+ messages in thread
From: Austin Clements @ 2012-06-01 14:16 UTC (permalink / raw)
  To: notmuch

Commit 5fddc07 changed this API, but missed this use of it.
---
 contrib/notmuch-deliver/src/main.c |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/contrib/notmuch-deliver/src/main.c b/contrib/notmuch-deliver/src/main.c
index 37d2919..032b9d6 100644
--- a/contrib/notmuch-deliver/src/main.c
+++ b/contrib/notmuch-deliver/src/main.c
@@ -359,6 +359,7 @@ main(int argc, char **argv)
 	GOptionContext *ctx;
 	GError *error = NULL;
 	notmuch_database_t *db;
+	notmuch_status_t status;
 
 	ctx = g_option_context_new("[FOLDER]");
 	g_option_context_add_main_entries(ctx, options, PACKAGE);
@@ -429,7 +430,14 @@ main(int argc, char **argv)
 		maildir = g_strdup(db_path);
 
 	g_debug("Opening notmuch database `%s'", db_path);
-	db = notmuch_database_open(db_path, NOTMUCH_DATABASE_MODE_READ_WRITE);
+	status = notmuch_database_open(db_path, NOTMUCH_DATABASE_MODE_READ_WRITE,
+				       &db);
+	if (status) {
+	    g_critical("Failed to open database `%s': %s",
+		       db_path, notmuch_status_to_string(status));
+	    g_free(maildir);
+	    return EX_SOFTWARE;
+	}
 	g_free(db_path);
 	if (db == NULL)
 		return EX_SOFTWARE;
-- 
1.7.10

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] notmuch-deliver: Update to new notmuch_database_open API
  2012-06-01 14:16 [PATCH] notmuch-deliver: Update to new notmuch_database_open API Austin Clements
@ 2012-06-01 14:34 ` David Bremner
  0 siblings, 0 replies; 2+ messages in thread
From: David Bremner @ 2012-06-01 14:34 UTC (permalink / raw)
  To: Austin Clements, notmuch

Austin Clements <amdragon@MIT.EDU> writes:

> Commit 5fddc07 changed this API, but missed this use of it.
> ---
>  contrib/notmuch-deliver/src/main.c |   10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)

Applies clean, notmuch-deliver builds. I have no easy way to test
notmuch-deliver, but this seems to be an improvement on the status quo,

I'm tempted to do another point release, with just this change.

Comments?

d

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-06-01 14:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-01 14:16 [PATCH] notmuch-deliver: Update to new notmuch_database_open API Austin Clements
2012-06-01 14:34 ` David Bremner

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).