From fe1ca1410423d99db09543f4a97bc2ba0c6ade81 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Fri, 18 May 2012 00:13:37 -0400 Subject: 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. --- lib/notmuch-private.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/notmuch-private.h') diff --git a/lib/notmuch-private.h b/lib/notmuch-private.h index 34f7ac7c..bfb41116 100644 --- a/lib/notmuch-private.h +++ b/lib/notmuch-private.h @@ -148,6 +148,9 @@ typedef enum _notmuch_private_status { /* Flags shared by various lookup functions. */ typedef enum _notmuch_find_flags { + /* Lookup without creating any documents. This is the default + * behavior. */ + NOTMUCH_FIND_LOOKUP = 0, /* If set, create the necessary document (or documents) if they * are missing. Requires a read/write database. */ NOTMUCH_FIND_CREATE = 1<<0, -- cgit v1.2.3