cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Autobuild test error Tru64

From: Guenter Knauf <eflash_at_gmx.net>
Date: Wed, 11 Jul 2007 20:21:02 +0200

Hi,
> You could use the <precheck> or <postcheck> sections of the errant test
> cases to call perl to do the usleep. But if this could affect any
> invocation of sockfilt, then it's probably better to add it just before
> sockfilt is started, wherever that is.
or perhaps modify sockfilt.c ??
something like that perhaps?

--- sockfilt.c.orig Mon Feb 19 03:04:02 2007
+++ sockfilt.c Wed Jul 11 20:19:14 2007
@@ -399,12 +399,18 @@
 #endif /* ENABLE_IPV6 */
   int flag = 1;
   int rc;
+ int maxretr = 10;
 
- if (setsockopt
- (sock, SOL_SOCKET, SO_REUSEADDR, (void *)&flag,
- sizeof(flag)) < 0) {
- perror("setsockopt(SO_REUSEADDR)");
+ rc = setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
+ (void *)&flag, sizeof(flag)));
+ while (rc < 0 && maxretr) {
+ maxewtr--;
+ usleep(10);
+ rc = setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
+ (void *)&flag, sizeof(flag)));
   }
+ if (rc < 0)
+ perror("setsockopt(SO_REUSEADDR)");
 
 #ifdef ENABLE_IPV6
   if(!use_ipv6) {

Guen.
Received on 2007-07-11