That should fix a race where the connect() directly followed by close()
in test_thread_echo_tcp_connect will cause the echo_srv to terminate
early, which results in connect() returning ECONNREFUSED in for other
threads.
This mainly happens on FreeBSD, but it can also happen on Linux.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
while (1) {
s = accept(sock, &addr.sa.s, &addr.sa_socklen);
+ if (s == -1 && errno == ECONNABORTED) {
+ continue;
+ }
if (s == -1) {
perror("accept");
goto done;