Commit f178a0c3 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Set FD_CLOEXEC on local socket.

parent 2b7d6b1f
......@@ -178,6 +178,14 @@ tcp_server_socket(int port, int local)
if(rc < 0)
goto fail;
rc = fcntl(s, F_GETFD, 0);
if(rc < 0)
goto fail;
rc = fcntl(s, F_SETFD, rc | FD_CLOEXEC);
if(rc < 0)
goto fail;
memset(&sin6, 0, sizeof(sin6));
sin6.sin6_family = AF_INET6;
sin6.sin6_port = htons(port);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment