diff options
author | Ali Polatel <alip@exherbo.org> | 2011-10-04 07:55:29 +0300 |
---|---|---|
committer | Ali Polatel <alip@exherbo.org> | 2011-10-04 07:55:29 +0300 |
commit | 02a30767116ad8abcbd0a3351f2e4d43bbbd655f (patch) | |
tree | 8997ef14cb1b3a64527ec8246e031fed92a170c5 /notmuch-new.c | |
parent | 9b3f16ce715d2371224955bc5b6f948eaa4ee325 (diff) |
lib: make find_message{,by_filename) report errors
Previously, the functions notmuch_database_find_message() and
notmuch_database_find_message_by_filename() functions did not properly
report error condition to the library user.
For more information, read the thread on the notmuch mailing list
starting with my mail "id:871uv2unfd.fsf@gmail.com"
Make these functions accept a pointer to 'notmuch_message_t' as argument
and return notmuch_status_t which may be used to check for any error
condition.
restore: Modify for the new notmuch_database_find_message()
new: Modify for the new notmuch_database_find_message_by_filename()
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 e79593c..96a1e31 100644 --- a/notmuch-new.c +++ b/notmuch-new.c @@ -743,7 +743,9 @@ remove_filename (notmuch_database_t *notmuch, status = notmuch_database_begin_atomic (notmuch); if (status) return status; - message = notmuch_database_find_message_by_filename (notmuch, path); + status = notmuch_database_find_message_by_filename (notmuch, path, &message); + if (status || message == NULL) + return status; status = notmuch_database_remove_message (notmuch, path); if (status == NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID) { add_files_state->renamed_messages++; |