From: Yang Tse Date: Wed, 13 May 2009 19:20:45 +0000 (+0000) Subject: log each setsockopt/SO_REUSEADDR failure X-Git-Tag: curl-7_19_5~17 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c31438b2f2ce78ab4cf824f06089772e66b47708;p=curl log each setsockopt/SO_REUSEADDR failure --- diff --git a/tests/server/sockfilt.c b/tests/server/sockfilt.c index 97e2e4ce0..2abdaa0df 100644 --- a/tests/server/sockfilt.c +++ b/tests/server/sockfilt.c @@ -688,13 +688,16 @@ static curl_socket_t sockdaemon(curl_socket_t sock, int delay= 20; int attempt = 0; int error = 0; + curl_socklen_t optlen; do { attempt++; + optlen = sizeof(flag); rc = setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, - (void *)&flag, sizeof(flag)); + (void *)&flag, optlen); if(rc) { error = SOCKERRNO; + logmsg("setsockopt/SO_REUSEADDR failed: (%d) %s", error, strerror(error)); if(maxretr) { rc = wait_ms(delay); if(rc) {