|
Lines 3933-3948
x11_create_display_inet(int x11_display_
Link Here
|
| 3933 |
if (ai->ai_family == AF_INET6) |
3933 |
if (ai->ai_family == AF_INET6) |
| 3934 |
sock_set_v6only(sock); |
3934 |
sock_set_v6only(sock); |
| 3935 |
if (x11_use_localhost) |
3935 |
if (x11_use_localhost) |
| 3936 |
channel_set_reuseaddr(sock); |
3936 |
channel_set_reuseaddr(sock); |
| 3937 |
if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0) { |
3937 |
if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0) { |
| 3938 |
debug2("bind port %d: %.100s", port, strerror(errno)); |
3938 |
debug2("bind port %d: %.100s", port, strerror(errno)); |
| 3939 |
close(sock); |
3939 |
close(sock); |
| 3940 |
|
3940 |
|
|
|
3941 |
/* do not remove successfully opened |
| 3942 |
* sockets if the request failed because |
| 3943 |
* the protocol IPv4/6 is not available |
| 3944 |
* (e.g. IPv6 may be disabled while being |
| 3945 |
* supported) |
| 3946 |
*/ |
| 3947 |
if (EADDRNOTAVAIL == errno) |
| 3948 |
continue; |
| 3949 |
|
| 3941 |
for (n = 0; n < num_socks; n++) { |
3950 |
for (n = 0; n < num_socks; n++) { |
| 3942 |
close(socks[n]); |
3951 |
close(socks[n]); |
| 3943 |
} |
3952 |
} |
| 3944 |
num_socks = 0; |
3953 |
num_socks = 0; |
| 3945 |
break; |
3954 |
break; |
| 3946 |
} |
3955 |
} |
| 3947 |
socks[num_socks++] = sock; |
3956 |
socks[num_socks++] = sock; |
| 3948 |
if (num_socks == NUM_SOCKS) |
3957 |
if (num_socks == NUM_SOCKS) |