From 8c77e406957efc4a35f9dc6ca75f1c25444be597 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 28 May 2025 21:29:37 -0500 Subject: [PATCH] Fix select() logging flood in very verbose mode (#8942) --- esphome/core/application.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/esphome/core/application.cpp b/esphome/core/application.cpp index 1cc96265ab..ad1ec33436 100644 --- a/esphome/core/application.cpp +++ b/esphome/core/application.cpp @@ -160,6 +160,10 @@ void Application::loop() { int ret = ::select(this->max_fd_ + 1, &this->read_fds_, nullptr, nullptr, &tv); #endif + // Process select() result: + // ret < 0: error (except EINTR which is normal) + // ret > 0: socket(s) have data ready - normal and expected + // ret == 0: timeout occurred - normal and expected if (ret < 0) { if (errno == EINTR) { // Interrupted by signal - this is normal, just continue @@ -170,11 +174,6 @@ void Application::loop() { ESP_LOGW(TAG, "select() failed with errno %d", errno); delay(delay_time); } - } else if (ret > 0) { - ESP_LOGVV(TAG, "select() woke early: %d socket(s) ready (saved up to %ums)", ret, delay_time); - } else { - // ret == 0: timeout occurred (normal) - ESP_LOGVV(TAG, "select() timeout after %ums (no sockets ready)", delay_time); } } else { // No sockets registered, use regular delay