From 42aadccc8b6bec7c0743993a9c46ceec7075388e Mon Sep 17 00:00:00 2001 From: levlam Date: Tue, 7 Dec 2021 13:10:30 +0300 Subject: [PATCH] Fix warning. --- tddb/td/db/binlog/Binlog.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tddb/td/db/binlog/Binlog.cpp b/tddb/td/db/binlog/Binlog.cpp index 7af598373..7480170cf 100644 --- a/tddb/td/db/binlog/Binlog.cpp +++ b/tddb/td/db/binlog/Binlog.cpp @@ -671,11 +671,11 @@ void Binlog::do_reindex() { auto finish_time = Clocks::monotonic(); auto finish_size = fd_size_; auto finish_events = fd_events_; - for (size_t i = 10; i > 0; i--) { + for (int left_tries = 10; left_tries > 0; left_tries--) { auto r_stat = stat(path_); if (r_stat.is_error()) { - if (i != 1) { - usleep_for(200000 / i); + if (left_tries != 1) { + usleep_for(200000 / left_tries); continue; } LOG(FATAL) << "Failed to rename binlog of size " << fd_size_ << " to " << path_ << ": " << r_stat.error()