X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-new.c;h=cb720cc2f9a76d36fd8a4194fd9d9dc07f3029f5;hp=473201e961cdb61fe51c1807a18b4161d3615f48;hb=f1c6e22ee60c6e546315368aa3c3d90be36cd945;hpb=2e7b6494046342872f1f79418679b1554d6d1005 diff --git a/notmuch-new.c b/notmuch-new.c index 473201e9..cb720cc2 100644 --- a/notmuch-new.c +++ b/notmuch-new.c @@ -900,12 +900,12 @@ notmuch_new_command (void *ctx, int argc, char *argv[]) return 1; printf ("Found %d total files (that's not much mail).\n", count); - notmuch = notmuch_database_create (db_path); + if (notmuch_database_create (db_path, ¬much)) + return 1; add_files_state.total_files = count; } else { - notmuch = notmuch_database_open (db_path, - NOTMUCH_DATABASE_MODE_READ_WRITE); - if (notmuch == NULL) + if (notmuch_database_open (db_path, NOTMUCH_DATABASE_MODE_READ_WRITE, + ¬much)) return 1; if (notmuch_database_needs_upgrade (notmuch)) { @@ -1041,7 +1041,7 @@ notmuch_new_command (void *ctx, int argc, char *argv[]) fprintf (stderr, "Note: A fatal error was encountered: %s\n", notmuch_status_to_string (ret)); - notmuch_database_close (notmuch); + notmuch_database_destroy (notmuch); if (run_hooks && !ret && !interrupted) ret = notmuch_run_hook (db_path, "post-new");