Skip to content
Snippets Groups Projects
Commit f7631b7a authored by Per Bothner's avatar Per Bothner Committed by Andy Green
Browse files

sockets: FD_CLOEXEC

If the user code forks, it inherits open copies of all
lws sockets, which conflict if lws later decides to
close them.
parent bd9c1b71
Branches
Tags
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment