[core] fall back to accept() if accept4() EPERM (fixes
On some architectures, accept4() might result in EPERM depending
on Linux kernel and/or glibc support for accept4()
(thx alex-che)
x-ref:
"accept4 returns EPERM instead of ENOSYS on some platforms"
@@ -637,9 +637,18 @@ int fdevent_accept_listenfd(int listenfd, struct sockaddr *addr, size_t *addrlen
fd = -1;
}
}
- } else if (errno == ENOSYS || errno == ENOTSUP) {
+ }
+ else {
+ switch (errno) {
+ case ENOSYS:
+ case ENOTSUP:
+ case EPERM:
fd = accept(listenfd, addr, &len);
sock_cloexec = 0;
+ break;
+ default:
+ break;
+ }
}
}
else {
