]> git.notmuchmail.org Git - notmuch/blobdiff - notmuch-restore.c
Merge branch 'release'
[notmuch] / notmuch-restore.c
index d3b9246237c54ee2561eecf4cba24499d2577d4e..4f4096ed15c79b11d06b97abfaa0be0b8fc2af5c 100644 (file)
@@ -115,9 +115,8 @@ notmuch_restore_command (unused (void *ctx), int argc, char *argv[])
     if (config == NULL)
        return 1;
 
-    notmuch = notmuch_database_open (notmuch_config_get_database_path (config),
-                                    NOTMUCH_DATABASE_MODE_READ_WRITE);
-    if (notmuch == NULL)
+    if (notmuch_database_open (notmuch_config_get_database_path (config),
+                              NOTMUCH_DATABASE_MODE_READ_WRITE, &notmuch))
        return 1;
 
     synchronize_flags = notmuch_config_get_maildir_synchronize_flags (config);
@@ -192,7 +191,7 @@ notmuch_restore_command (unused (void *ctx), int argc, char *argv[])
     if (line)
        free (line);
 
-    notmuch_database_close (notmuch);
+    notmuch_database_destroy (notmuch);
     if (input != stdin)
        fclose (input);