]> git.notmuchmail.org Git - notmuch/commitdiff
notmuch-deliver: Update to new notmuch_database_open API
authorAustin Clements <amdragon@MIT.EDU>
Fri, 1 Jun 2012 14:16:49 +0000 (10:16 -0400)
committerDavid Bremner <bremner@debian.org>
Fri, 1 Jun 2012 14:31:26 +0000 (11:31 -0300)
Commit 5fddc07 changed this API, but missed this use of it.

contrib/notmuch-deliver/src/main.c

index 37d2919a54620e1088fe2100292bb0af3c9d406e..032b9d6297daa14f850b4cccfb83013e53716070 100644 (file)
@@ -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;