aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compat/imsg.c8
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;
+ }
}
}