Commit 9fe70c9e by Andreas Smas

Use SOCK_CLOEXEC when creating sockets

parent c7c5f2c4
......@@ -60,6 +60,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