Commit 52426b0f authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Set FD_CLOEXEC on socket.

parent 67f8ce0b
...@@ -75,6 +75,14 @@ babel_socket(int port) ...@@ -75,6 +75,14 @@ babel_socket(int port)
if(rc < 0) if(rc < 0)
goto fail; 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)); memset(&sin6, 0, sizeof(sin6));
sin6.sin6_family = AF_INET6; sin6.sin6_family = AF_INET6;
sin6.sin6_port = htons(port); 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