aboutsummaryrefslogtreecommitdiff
path: root/lib/database.cc
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2021-03-14 11:01:59 -0300
committerDavid Bremner <david@tethera.net>2021-03-18 08:04:06 -0300
commit13efbd0e1c88fcbdb48b4c30c7852c5bf1fbd0b7 (patch)
tree601d78a964f42acf4c3d41b813e70fadc27eda82 /lib/database.cc
parentf0717aa380cfa84c1973f7b03948d93b261a73fe (diff)
lib: support reopening databases for write access.
In the future Xapian will apparently support this more conveniently for the cases other than READ_ONLY => READ_ONLY Conceptually this function seems to fit better in lib/open.cc; database.cc is still large enough that moving the function makes sense.
Diffstat (limited to 'lib/database.cc')
-rw-r--r--lib/database.cc23
1 files changed, 0 insertions, 23 deletions
diff --git a/lib/database.cc b/lib/database.cc
index 82ac5f20..fc13b53b 100644
--- a/lib/database.cc
+++ b/lib/database.cc
@@ -517,29 +517,6 @@ notmuch_database_close (notmuch_database_t *notmuch)
return status;
}
-notmuch_status_t
-notmuch_database_reopen (notmuch_database_t *notmuch,
- unused(notmuch_database_mode_t mode))
-{
- if (_notmuch_database_mode (notmuch) != NOTMUCH_DATABASE_MODE_READ_ONLY)
- return NOTMUCH_STATUS_UNSUPPORTED_OPERATION;
-
- try {
- notmuch->xapian_db->reopen ();
- } catch (const Xapian::Error &error) {
- if (! notmuch->exception_reported) {
- _notmuch_database_log (notmuch, "Error: A Xapian exception reopening database: %s\n",
- error.get_msg ().c_str ());
- notmuch->exception_reported = true;
- }
- return NOTMUCH_STATUS_XAPIAN_EXCEPTION;
- }
-
- notmuch->view++;
-
- return NOTMUCH_STATUS_SUCCESS;
-}
-
static int
unlink_cb (const char *path,
unused (const struct stat *sb),