Browse Source

[core] fall back to accept() if accept4() EPERM (fixes #2998)

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"
  https://redmine.lighttpd.net/issues/2998
personal/stbuehler/ci-build
Glenn Strauss 2 years ago
parent
commit
fce489b806
  1. 15
      src/fdevent.c

15
src/fdevent.c

@ -637,9 +637,18 @@ int fdevent_accept_listenfd(int listenfd, struct sockaddr *addr, size_t *addrlen
fd = -1;
}
}
} else if (errno == ENOSYS || errno == ENOTSUP) {
fd = accept(listenfd, addr, &len);
sock_cloexec = 0;
}
else {
switch (errno) {
case ENOSYS:
case ENOTSUP:
case EPERM:
fd = accept(listenfd, addr, &len);
sock_cloexec = 0;
break;
default:
break;
}
}
}
else {

Loading…
Cancel
Save