summaryrefslogtreecommitdiff
path: root/database.cc
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2009-10-25 15:01:20 -0700
committerCarl Worth <cworth@cworth.org>2009-10-25 15:01:20 -0700
commitbe9e3ee3132457ea5936bd1225294bdfe3949a4c (patch)
treea6d42aa2bc34bb28ea03b8bef3ad3e290421df07 /database.cc
parenta360670c03475b1489ea5e2327cc3037cc8dff0b (diff)
_notmuch_database_linke_message: Fix error-status propagation.
The _notmuch_database_link_message_to_parents function was void in an earlier draft. Now, ensure that we don't miss any error return value from it.
Diffstat (limited to 'database.cc')
-rw-r--r--database.cc18
1 files changed, 11 insertions, 7 deletions
diff --git a/database.cc b/database.cc
index ea20705..cd05784 100644
--- a/database.cc
+++ b/database.cc
@@ -798,20 +798,24 @@ _notmuch_database_link_message (notmuch_database_t *notmuch,
notmuch_message_t *message,
notmuch_message_file_t *message_file)
{
- notmuch_status_t ret = NOTMUCH_STATUS_SUCCESS;
+ notmuch_status_t status;
const char *thread_id = NULL;
- _notmuch_database_link_message_to_parents (notmuch, message,
- message_file,
- &thread_id);
+ status = _notmuch_database_link_message_to_parents (notmuch, message,
+ message_file,
+ &thread_id);
+ if (status)
+ return status;
- ret = _notmuch_database_link_message_to_children (notmuch, message,
- &thread_id);
+ status = _notmuch_database_link_message_to_children (notmuch, message,
+ &thread_id);
+ if (status)
+ return status;
if (thread_id == NULL)
_notmuch_message_ensure_thread_id (message);
- return ret;
+ return NOTMUCH_STATUS_SUCCESS;
}
notmuch_status_t