]> git.notmuchmail.org Git - notmuch/blobdiff - lib/directory.cc
lib: encapsulate the use of notmuch_database_t field 'mode'
[notmuch] / lib / directory.cc
index 09b49245e94468c9dae27d7425e6426249bb9189..eaba65ab60c7bf656809e23e1c805269d274b1c5 100644 (file)
@@ -114,7 +114,7 @@ _notmuch_directory_find_or_create (notmuch_database_t *notmuch,
 
     path = _notmuch_database_relative_path (notmuch, path);
 
-    if (create && notmuch->mode == NOTMUCH_DATABASE_MODE_READ_ONLY)
+    if (create && _notmuch_database_mode (notmuch) == NOTMUCH_DATABASE_MODE_READ_ONLY)
        INTERNAL_ERROR ("Failure to ensure database is writable");
 
     directory = talloc (notmuch, notmuch_directory_t);