tests/echo_srv: make the main server logic resilient to ECONNABORTED from accept()
[socket_wrapper.git] / tests / echo_srv.c
index 87c85f74b22a96ca54878de502b98c3d5e123141..0aefa9aa9825f76c2e90535a52adc5eba90afc5a 100644 (file)
@@ -538,6 +538,9 @@ static void echo_tcp(int sock)
 
     while (1) {
         s = accept(sock, &addr.sa.s, &addr.sa_socklen);
+        if (s == -1 && errno == ECONNABORTED) {
+            continue;
+        }
         if (s == -1) {
             perror("accept");
             goto done;