changeset 22323:a0258a81ec84

lib-index: Use nfs_safe_stat() to avoid having to handle stat() ESTALE error Slightly simplifies the code.
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Tue, 11 Jul 2017 14:31:10 +0300
parents 97f8c7098b30
children 8be59fab1d63
files src/lib-index/mail-transaction-log.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mail-transaction-log.c	Mon Jul 10 16:11:48 2017 +0300
+++ b/src/lib-index/mail-transaction-log.c	Tue Jul 11 14:31:10 2017 +0300
@@ -43,8 +43,8 @@
 	if (MAIL_INDEX_IS_IN_MEMORY(log->index))
 		return;
 
-	if (stat(log->filepath2, &st) < 0) {
-		if (errno != ENOENT && errno != ESTALE) {
+	if (nfs_safe_stat(log->filepath2, &st) < 0) {
+		if (errno != ENOENT) {
 			mail_index_set_error(log->index,
 				"stat(%s) failed: %m", log->filepath2);
 		}