_notmuch_database_linke_message: Fix error-status propagation.
authorCarl Worth <cworth@cworth.org>
Sun, 25 Oct 2009 22:01:20 +0000 (15:01 -0700)
committerCarl Worth <cworth@cworth.org>
Sun, 25 Oct 2009 22:01:20 +0000 (15:01 -0700)
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.

database.cc

index ea20705509060334b181f40db5d5254a326720f0..cd057846455605c2a01f270f84efa8731d6dcbb1 100644 (file)
@@ -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