changeset 22482:c5387cdc3964

lib-index: mail_index_use_existing_permissions() - Log error if stat() unexpectedly fails
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Mon, 11 Sep 2017 12:58:28 +0300
parents 658e239267b2
children 2a7fb92d36eb
files src/lib-index/mail-index.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mail-index.c	Thu Jul 27 16:34:34 2017 +0200
+++ b/src/lib-index/mail-index.c	Mon Sep 11 12:58:28 2017 +0300
@@ -108,8 +108,11 @@
 {
 	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) {