From: Carl Worth Date: Thu, 11 Nov 2010 11:50:42 +0000 (-0800) Subject: notmuch_message_tags_to_maildir_flags: Don't exit on failure to rename. X-Git-Tag: 0.5~26 X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=commitdiff_plain;h=37a8096fdc0584567aab43a8bede7b32860a3517 notmuch_message_tags_to_maildir_flags: Don't exit on failure to rename. It is totally legitimate for a non-maildir directory to be named "new" (and not have a directory next to it named "cur"). To support this case at least, be silent about any rename failure. --- diff --git a/lib/message.cc b/lib/message.cc index 8ae92901..b4bf0ce0 100644 --- a/lib/message.cc +++ b/lib/message.cc @@ -1009,15 +1009,11 @@ notmuch_message_tags_to_maildir_flags (notmuch_message_t *message) strcpy (filename_new+(p-filename)+3, flags); if (strcmp (filename, filename_new) != 0) { - notmuch_status_t status; + notmuch_status_t status = NOTMUCH_STATUS_SUCCESS; ret = rename (filename, filename_new); - if (ret == -1) { - perror (talloc_asprintf (message, "rename of %s to %s failed", - filename, filename_new)); - exit (1); - } - status = _notmuch_message_rename (message, filename_new); + if (ret == 0) + status = _notmuch_message_rename (message, filename_new); _notmuch_message_sync (message);