diff options
author | Steven Murdoch <Steven.Murdoch@cl.cam.ac.uk> | 2010-12-01 15:40:11 +0000 |
---|---|---|
committer | Steven Murdoch <Steven.Murdoch@cl.cam.ac.uk> | 2010-12-01 15:40:11 +0000 |
commit | 367794ce02d696c2b62d0cca5d3e7a1211c0c28a (patch) | |
tree | 3e1d6ad59fadcaad955a1ee9f2c3516bf2cd328e /src | |
parent | 786abbd54c77d4d39488e27ddde0b26ee5c9478f (diff) | |
download | tor-367794ce02d696c2b62d0cca5d3e7a1211c0c28a.tar tor-367794ce02d696c2b62d0cca5d3e7a1211c0c28a.tar.gz |
Open connection to DNS resolvers with CLOEXEC flag set
NB: this will now register the socket with the socket accounting code
Diffstat (limited to 'src')
-rw-r--r-- | src/or/eventdns.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/eventdns.c b/src/or/eventdns.c index 0665cf53e..4c6f60e89 100644 --- a/src/or/eventdns.c +++ b/src/or/eventdns.c @@ -2286,7 +2286,7 @@ _evdns_nameserver_add_impl(const struct sockaddr *address, evtimer_set(&ns->timeout_event, nameserver_prod_callback, ns); - ns->socket = socket(PF_INET, SOCK_DGRAM, 0); + ns->socket = tor_open_socket(PF_INET, SOCK_DGRAM, 0); if (ns->socket < 0) { err = 1; goto out1; } #ifdef WIN32 { @@ -3455,7 +3455,7 @@ main(int c, char **v) { if (servertest) { int sock; struct sockaddr_in my_addr; - sock = socket(PF_INET, SOCK_DGRAM, 0); + sock = tor_open_socket(PF_INET, SOCK_DGRAM, 0); fcntl(sock, F_SETFL, O_NONBLOCK); my_addr.sin_family = AF_INET; my_addr.sin_port = htons(10053); |