]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: fs_list_get_mailbox_flags() - Return mailbox files as selectable
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 30 May 2017 06:15:09 +0000 (09:15 +0300)
committerGitLab <gitlab@git.dovecot.net>
Tue, 30 May 2017 07:00:34 +0000 (10:00 +0300)
Avoids a second stat() later on, which would do the same anyway.

src/lib-storage/list/mailbox-list-fs-flags.c

index 828ee5d6fec775fa5bcf84bd1fc979ea3e1f89af..b21032742a1d8c9d52996d203142f5a85c26fb31 100644 (file)
@@ -200,6 +200,11 @@ int fs_list_get_mailbox_flags(struct mailbox_list *list,
                } else {
                        *flags_r |= MAILBOX_NOINFERIORS;
                }
+               /* Return mailbox files as always existing. The current
+                  mailbox_exists() code would do the same stat() anyway
+                  without further checks, so might as well avoid the second
+                  stat(). */
+               *flags_r |= MAILBOX_SELECT;
                *flags_r |= STAT_GET_MARKED_FILE(st);
                return 1;
        }