if (errno == EADDRINUSE && i != 1) {
if (errno == EADDRINUSE) {
bool is_double_binding_sane(void){	int err, port;	struct addrinfo hints, *res = NULL, *ptr;		if (is_getaddinfo_sane() == FALSE) 		return FALSE;	memset(&hints, 0, sizeof(hints));	hints.ai_family   = AF_UNSPEC;	hints.ai_flags    = AI_PASSIVE;	hints.ai_socktype = SOCK_STREAM;		port = 1025;		for (;;) {		int i;		struct bound_socket_t* list = NULL;		char service[80];		snprintf(service, sizeof(service), "%d", port);		service[sizeof(service) - 1] = '\0'; 		err = getaddrinfo(NULL, service, &hints, &res);		if (err != 0) {			fatal("getaddinfo failed: %s", gai_strerror(err));		}			assert(res != NULL);		for (i = 1, ptr = res; ptr != NULL; ptr=ptr->ai_next, ++i) {			int fd;					fd = socket(ptr->ai_family, ptr->ai_socktype, 				    ptr->ai_protocol);			if (fd < 0) {				/* ignore this address if it is not supported */	                        if (unsupported_sock_error(errno))	                                continue;	                        fatal("cannot create the socket: %s", 				      strerror(errno));			}			#if defined(ENABLE_IPV6) && defined(IPV6_V6ONLY)			if (ptr->ai_family == PF_INET6) {				int on = 1;				/* in case of error, we will go on anyway... */				err = setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY,				                 &on, sizeof(on));				if (err < 0) 					perror("error with sockopt IPV6_V6ONLY");			}#endif 						err = bind(fd, ptr->ai_addr, ptr->ai_addrlen);			if (err < 0) {				fprintf(stderr, "bind returned %d, (%s)\n", 				        err, strerror(errno));				if (errno == EADDRINUSE && i != 1) {					close_and_destroy_bound_sockets(list);					return FALSE;				}	                        fatal("cannot bind to the socket: %s", 				      strerror(errno));			}						list = add_bound_socket(list, fd, ptr->ai_socktype);		}				close_and_destroy_bound_sockets(list);		break;		}	return TRUE;}