aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sandbox.c1
-rw-r--r--server.c4
2 files changed, 4 insertions, 1 deletions
diff --git a/sandbox.c b/sandbox.c
index 69ed053..9baec82 100644
--- a/sandbox.c
+++ b/sandbox.c
@@ -153,6 +153,7 @@ sandbox()
#endif
SC_ALLOW(epoll_pwait),
SC_ALLOW(epoll_ctl),
+ SC_ALLOW(accept),
SC_ALLOW(accept4),
SC_ALLOW(read),
SC_ALLOW(openat),
diff --git a/server.c b/server.c
index c6f83b8..777815e 100644
--- a/server.c
+++ b/server.c
@@ -980,12 +980,14 @@ do_accept(int sock, short et, void *d)
saddr = (struct sockaddr*)&addr;
len = sizeof(addr);
- if ((fd = accept4(sock, saddr, &len, SOCK_NONBLOCK)) == -1) {
+ if ((fd = accept(sock, saddr, &len)) == -1) {
if (errno == EWOULDBLOCK || errno == EAGAIN)
return;
fatal("accept: %s", strerror(errno));
}
+ mark_nonblock(fd);
+
for (i = 0; i < MAX_USERS; ++i) {
c = &s->clients[i];
if (c->fd == -1) {