enum { mbf_unix, mbf_mbx, mbf_smail, mbf_maildir, mbf_mailstore };
-static char *mailbox_formats[] = {
+static const char *mailbox_formats[] = {
"unix", "mbx", "smail", "maildir", "mailstore" };
"%s/maildirsize", check_path);
return FALSE;
}
+ /* can also return -2, which means that the file was removed because of
+ raciness; but in this case, the size & filecount will still have been
+ updated. */
if (mailbox_size < 0) mailbox_size = size;
if (mailbox_filecount < 0) mailbox_filecount = filecount;
if (yield == OK && maildirsize_fd >= 0)
maildir_record_length(maildirsize_fd, message_size);
maildir_save_errno = errno; /* Preserve errno while closing the file */
- (void)close(maildirsize_fd);
+ if (maildirsize_fd >= 0)
+ (void)close(maildirsize_fd);
errno = maildir_save_errno;
}
#endif /* SUPPORT_MAILDIR */