From: Timo Sirainen Date: Mon, 11 Sep 2017 09:58:28 +0000 (+0300) Subject: lib-index: mail_index_use_existing_permissions() - Log error if stat() unexpectedly... X-Git-Tag: 2.2.33.rc1~94 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fb57fe1aaafcb298fb34b60e0bae16778734efe9;p=thirdparty%2Fdovecot%2Fcore.git lib-index: mail_index_use_existing_permissions() - Log error if stat() unexpectedly fails --- diff --git a/src/lib-index/mail-index.c b/src/lib-index/mail-index.c index b919c788b1..4576691765 100644 --- a/src/lib-index/mail-index.c +++ b/src/lib-index/mail-index.c @@ -108,8 +108,11 @@ bool mail_index_use_existing_permissions(struct mail_index *index) { struct stat st; - if (stat(index->dir, &st) < 0) + if (stat(index->dir, &st) < 0) { + if (errno != ENOENT) + i_error("stat(%s) failed: %m", index->dir); return FALSE; + } index->mode = st.st_mode & 0666; if (S_ISDIR(st.st_mode) && (st.st_mode & S_ISGID) != 0) {