diff options
author | Austin Clements <amdragon@MIT.EDU> | 2012-05-18 00:13:37 -0400 |
---|---|---|
committer | David Bremner <bremner@debian.org> | 2012-05-23 22:30:55 -0300 |
commit | fe1ca1410423d99db09543f4a97bc2ba0c6ade81 (patch) | |
tree | d879494317f6894cedcf00e587aac1aff823114a /lib/notmuch.h | |
parent | 67ae2377a9ec2da296a2e012352f962664a4d1a8 (diff) |
lib: Make notmuch_database_get_directory return NULL if the directory is not found
Using the new support from _notmuch_directory_create, this makes
notmuch_database_get_directory a read-only operation that simply
returns the directory object if it exists or NULL otherwise. This
also means that notmuch_database_get_directory can work on read-only
databases.
This change breaks the directory mtime workaround in notmuch-new.c by
fixing the exact issue it was working around. This permits mtime
update races to prevent scans of changed directories, which
non-deterministically breaks a few tests. The next patch fixes this.
Diffstat (limited to 'lib/notmuch.h')
-rw-r--r-- | lib/notmuch.h | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/notmuch.h b/lib/notmuch.h index bbb17e4a..3633bedd 100644 --- a/lib/notmuch.h +++ b/lib/notmuch.h @@ -300,10 +300,8 @@ notmuch_database_end_atomic (notmuch_database_t *notmuch); * (see notmuch_database_get_path), or else should be an absolute path * with initial components that match the path of 'database'. * - * Note: Currently this will create the directory object if it doesn't - * exist. In the future, when a directory object does not exist this - * will return NOTMUCH_STATUS_SUCCESS and set *directory to NULL. - * Callers should be prepared for this. + * If this directory object does not exist in the database, this + * returns NOTMUCH_STATUS_SUCCESS and sets *directory to NULL. * * Return value: * @@ -313,10 +311,6 @@ notmuch_database_end_atomic (notmuch_database_t *notmuch); * * NOTMUCH_STATUS_XAPIAN_EXCEPTION: A Xapian exception occurred; * directory not retrieved. - * - * NOTMUCH_STATUS_READ_ONLY_DATABASE: Database was opened in read-only - * mode so the directory cannot be created (this case will be - * removed in the future). */ notmuch_status_t notmuch_database_get_directory (notmuch_database_t *database, |