]> 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 11:30:12 +0000 (14:30 +0300)
Slightly simplifies the code.

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

index 354b6f1e993736f79e5150eea776cc6450567aa4..3391c610c3090c88241c8206e134149c1e93a5cb 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);
                }