diff --git a/lib/plat/unix/unix-sockets.c b/lib/plat/unix/unix-sockets.c index a46990160..01bd32c21 100644 --- a/lib/plat/unix/unix-sockets.c +++ b/lib/plat/unix/unix-sockets.c @@ -74,6 +74,8 @@ lws_plat_set_socket_options(struct lws_vhost *vhost, int fd) struct protoent *tcp_proto; #endif + fcntl(fd, F_SETFD, FD_CLOEXEC); + if (vhost->ka_time) { /* enable keepalive on this socket */ optval = 1;