aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/message.cc
diff options
context:
space:
mode:
authorGravatar Carl Worth <cworth@cworth.org>2010-11-11 03:50:42 -0800
committerGravatar Carl Worth <cworth@cworth.org>2010-11-11 03:50:42 -0800
commit37a8096fdc0584567aab43a8bede7b32860a3517 (patch)
treec1b5ef72ea21e0a85eb49587c3ea28e2fc053759 /lib/message.cc
parent483f422699cc480b856ceeac77a4fa5d11f82ea0 (diff)
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.
Diffstat (limited to 'lib/message.cc')
-rw-r--r--lib/message.cc10
1 files changed, 3 insertions, 7 deletions
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);