mirror of
https://github.com/tmux/tmux.git
synced 2025-01-08 08:58:47 +00:00
Fix available_fds when there is no AF_INET, reported by Mathieu Arnold.
This commit is contained in:
parent
7120ab2f16
commit
f199fb6a2b
@ -51,10 +51,14 @@ available_fds(unsigned int n)
|
|||||||
for (i = 0; i < n; i++) {
|
for (i = 0; i < n; i++) {
|
||||||
fds[i] = -1;
|
fds[i] = -1;
|
||||||
if ((fds[i] = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
|
if ((fds[i] = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
|
||||||
|
if (errno == EAFNOSUPPORT || errno == EPROTONOSUPPORT)
|
||||||
|
fds[i] = socket(AF_INET6, SOCK_DGRAM, 0);
|
||||||
|
if (fds[i] < 0) {
|
||||||
ret = 1;
|
ret = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < n && fds[i] >= 0; i++)
|
for (i = 0; i < n && fds[i] >= 0; i++)
|
||||||
close(fds[i]);
|
close(fds[i]);
|
||||||
|
Loading…
Reference in New Issue
Block a user