diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2015-10-15 09:24:25 +0100 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2015-10-15 09:24:25 +0100 |
commit | f199fb6a2b53c99fb92de3db5a7e03ac73fb0db4 (patch) | |
tree | 38ebea598422051516c1812d86155705674f1bff /compat/imsg.c | |
parent | 7120ab2f161a5762d16aba54451d29dcd0fbbeeb (diff) | |
download | rtmux-f199fb6a2b53c99fb92de3db5a7e03ac73fb0db4.tar.gz rtmux-f199fb6a2b53c99fb92de3db5a7e03ac73fb0db4.tar.bz2 rtmux-f199fb6a2b53c99fb92de3db5a7e03ac73fb0db4.zip |
Fix available_fds when there is no AF_INET, reported by Mathieu Arnold.
Diffstat (limited to 'compat/imsg.c')
-rw-r--r-- | compat/imsg.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/compat/imsg.c b/compat/imsg.c index 982ee069..6c9bee68 100644 --- a/compat/imsg.c +++ b/compat/imsg.c @@ -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; + } } } |