mirror of
https://github.com/tmate-io/tmate.git
synced 2024-11-07 16:54:01 +01:00
Fix available_fds when there is no AF_INET, reported by Mathieu Arnold.
This commit is contained in:
parent
7120ab2f16
commit
f199fb6a2b
@ -51,8 +51,12 @@ available_fds(unsigned int n)
|
||||
for (i = 0; i < n; i++) {
|
||||
fds[i] = -1;
|
||||
if ((fds[i] = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
|
||||
ret = 1;
|
||||
break;
|
||||
if (errno == EAFNOSUPPORT || errno == EPROTONOSUPPORT)
|
||||
fds[i] = socket(AF_INET6, SOCK_DGRAM, 0);
|
||||
if (fds[i] < 0) {
|
||||
ret = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user