]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-index: Use nfs_safe_stat() to avoid having to handle stat() ESTALE error
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 11 Jul 2017 11:31:10 +0000 (14:31 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 12 Jul 2017 21:43:50 +0000 (00:43 +0300)
Slightly simplifies the code.

src/lib-index/mail-transaction-log.c

index 40d09952c08f7481b1a5331c3ad761c1a732daff..bc7518ba181f8c6d89d3433479fa024863aa4f8e 100644 (file)
@@ -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);
                }