This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git

commit 6799fa3e05719a9e585d87cf8615be129a70cece
Author: Marco Casaroli <[email protected]>
AuthorDate: Sat Nov 21 18:37:59 2026 +0100

    testing/nettest: Restart select() of the loopback server after a signal.
    
    nettest_lo_listener() ends when select() fails.  A signal to the test
    process can go to the server thread (test_tcp_reset_send gets SIGPIPE),
    and select() then fails with EINTR.  The server ends, the next cases
    that use it fail, and the group teardown fails with ECONNREFUSED, in
    flat and kernel builds.
    
    Call select() again after EINTR.
    
    Assisted-by: Claude Code:claude-opus-5-5
    Signed-off-by: Marco Casaroli <[email protected]>
---
 testing/nettest/utils/nettest_tcpserver.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/testing/nettest/utils/nettest_tcpserver.c 
b/testing/nettest/utils/nettest_tcpserver.c
index c9f56668f..4843c17e0 100644
--- a/testing/nettest/utils/nettest_tcpserver.c
+++ b/testing/nettest/utils/nettest_tcpserver.c
@@ -22,6 +22,7 @@
  * Included Files
  ****************************************************************************/
 
+#include <errno.h>
 #include <netinet/in.h>
 #include <semaphore.h>
 #include <stdbool.h>
@@ -330,6 +331,11 @@ FAR static void *nettest_lo_listener(pthread_addr_t pvarg)
 
       memcpy(&nls.working, &nls.master, sizeof(fd_set));
       ret = select(nls.mxsd + 1, &nls.working, NULL, NULL, NULL);
+      if (ret < 0 && errno == EINTR)
+        {
+          continue;
+        }
+
       if (ret < 0)
         {
           break;

Reply via email to