diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2009-11-21 19:54:25 +0000 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2009-11-21 22:04:49 +0100 |
commit | f379aa52845f5594aa6cc2e7cf131d5f57202bbf (patch) | |
tree | 1befbaa8796388c58fd40459ea42b93881af008e /notmuch-new.c | |
parent | aac1d6035238f6a2b18c0dc0d7a5190a2187c511 (diff) |
Permit opening the notmuch database in read-only mode.
We only rarely need to actually open the database for writing, but we
always create a Xapian::WritableDatabase. This has the effect of
preventing searches and like whilst updating the index.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Carl Worth <cworth@cworth.org>
Diffstat (limited to 'notmuch-new.c')
-rw-r--r-- | notmuch-new.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/notmuch-new.c b/notmuch-new.c index 1b055848..f241edf9 100644 --- a/notmuch-new.c +++ b/notmuch-new.c @@ -193,6 +193,7 @@ add_files_recursive (notmuch_database_t *notmuch, next); break; /* Fatal issues. Don't process anymore. */ + case NOTMUCH_STATUS_READONLY_DATABASE: case NOTMUCH_STATUS_XAPIAN_EXCEPTION: case NOTMUCH_STATUS_OUT_OF_MEMORY: fprintf (stderr, "Error: %s. Halting processing.\n", @@ -412,7 +413,8 @@ notmuch_new_command (void *ctx, add_files_state.ignore_read_only_directories = FALSE; add_files_state.total_files = count; } else { - notmuch = notmuch_database_open (db_path); + notmuch = notmuch_database_open (db_path, + NOTMUCH_DATABASE_MODE_READONLY); add_files_state.ignore_read_only_directories = TRUE; add_files_state.total_files = 0; } |