Commit c2702235 by Andreas Smas Committed by Patrick Steinhardt

Use SOCK_CLOEXEC when creating sockets

parent 93ecb61a
......@@ -59,6 +59,9 @@
#ifndef O_CLOEXEC
#define O_CLOEXEC 0
#endif
#ifndef SOCK_CLOEXEC
#define SOCK_CLOEXEC 0
#endif
/* access() mode parameter #defines */
#ifndef F_OK
......
......@@ -104,7 +104,7 @@ int socket_connect(git_stream *stream)
}
for (p = info; p != NULL; p = p->ai_next) {
s = socket(p->ai_family, p->ai_socktype, p->ai_protocol);
s = socket(p->ai_family, p->ai_socktype | SOCK_CLOEXEC, p->ai_protocol);
if (s == INVALID_SOCKET)
continue;
......
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