From: Timo Sirainen Date: Tue, 11 Jul 2017 11:31:10 +0000 (+0300) Subject: lib-index: Use nfs_safe_stat() to avoid having to handle stat() ESTALE error X-Git-Tag: 2.3.0.rc1~1272 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2219501dc63a6fc5ab6346ea0b0df8d44a3b97d1;p=thirdparty%2Fdovecot%2Fcore.git lib-index: Use nfs_safe_stat() to avoid having to handle stat() ESTALE error Slightly simplifies the code. --- diff --git a/src/lib-index/mail-transaction-log.c b/src/lib-index/mail-transaction-log.c index 354b6f1e99..3391c610c3 100644 --- a/src/lib-index/mail-transaction-log.c +++ b/src/lib-index/mail-transaction-log.c @@ -43,8 +43,8 @@ static void mail_transaction_log_2_unlink_old(struct mail_transaction_log *log) 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); }