From 7e17d44f6f73645eb533cd61fb8b0da865673490 Mon Sep 17 00:00:00 2001 From: David Cermak Date: Wed, 20 Sep 2023 09:46:39 +0200 Subject: [PATCH] fix(modem): Fix vfs terminal not to reset read_cb() automatically This change is needed for the fs terminal to work correctly again, after merging 44bae24c78d15f8b0a028e3016d5043c1198fe01 which shifted responsibility of thread safety from a terminal to the DTE. (Before it was the terminal, which removed this callback safely when processing completed, and thus we had to check the callback return value). Not the DTE layers are responsible for thread safety and the return value indicates success/failure from processing. --- components/esp_modem/src/esp_modem_term_fs.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/components/esp_modem/src/esp_modem_term_fs.cpp b/components/esp_modem/src/esp_modem_term_fs.cpp index fde9c40ce45..1bbc06a46ef 100644 --- a/components/esp_modem/src/esp_modem_term_fs.cpp +++ b/components/esp_modem/src/esp_modem_term_fs.cpp @@ -122,9 +122,7 @@ void FdTerminal::task() } else { if (FD_ISSET(f.fd, &rfds)) { if (on_read_priv) { - if (on_read_priv(nullptr, 0)) { - on_read_priv = nullptr; - } + on_read_priv(nullptr, 0); } } }