about summary refs log tree commit diff
path: root/resolv/res_hconf.c
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2014-11-03 18:51:40 -0200
committerAlexandre Oliva <aoliva@redhat.com>2014-11-07 07:18:52 -0200
commit6286965b02069369beeb893833c34f01dc919ffb (patch)
treebf506982de6a7db5f575ed29933b1e0bf7e8b169 /resolv/res_hconf.c
parentc83b8a87170cda275a5c591fe2a1d3657d2a6711 (diff)
downloadglibc-6286965b02069369beeb893833c34f01dc919ffb.tar.gz
glibc-6286965b02069369beeb893833c34f01dc919ffb.tar.xz
glibc-6286965b02069369beeb893833c34f01dc919ffb.zip
create all sockets with SOCK_CLOEXEC
Diffstat (limited to 'resolv/res_hconf.c')
-rw-r--r--resolv/res_hconf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/resolv/res_hconf.c b/resolv/res_hconf.c
index b4c86227f8..1df336c699 100644
--- a/resolv/res_hconf.c
+++ b/resolv/res_hconf.c
@@ -41,6 +41,7 @@
 #include <sys/ioctl.h>
 #include <unistd.h>
 #include <netinet/in.h>
+#include <socket-cloexec.h>
 #include <bits/libc-lock.h>
 #include "ifreq.h"
 #include "res_hconf.h"
@@ -410,7 +411,7 @@ _res_hconf_reorder_addrs (struct hostent *hp)
       /* Initialize interface table.  */
 
       /* The SIOCGIFNETMASK ioctl will only work on an AF_INET socket.  */
-      sd = __socket (AF_INET, SOCK_DGRAM, 0);
+      sd = __socket_cloexec (AF_INET, SOCK_DGRAM, 0, true);
       if (sd < 0)
 	return;