about summary refs log tree commit diff
path: root/nis
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2015-10-17 12:02:37 +0200
committerFlorian Weimer <fweimer@redhat.com>2015-10-17 12:02:37 +0200
commit52fb79d6cdecb89a6f0375091e7c12ed79ae6760 (patch)
treee4885bfee90d7fe9f584518d3bc242050c725ef0 /nis
parentf546f87c4ffb1642ffc96b8d614c329ed35252c3 (diff)
downloadglibc-52fb79d6cdecb89a6f0375091e7c12ed79ae6760.tar.gz
glibc-52fb79d6cdecb89a6f0375091e7c12ed79ae6760.tar.xz
glibc-52fb79d6cdecb89a6f0375091e7c12ed79ae6760.zip
Assume that SOCK_CLOEXEC is available and works
This fixes (harmless) data races when accessing the various
__have_sock_cloexec variables.
Diffstat (limited to 'nis')
-rw-r--r--nis/ypclnt.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/nis/ypclnt.c b/nis/ypclnt.c
index 3a738726b4..93a95d60a0 100644
--- a/nis/ypclnt.c
+++ b/nis/ypclnt.c
@@ -68,25 +68,11 @@ yp_bind_client_create (const char *domain, dom_binding *ysd,
   ysd->dom_domain[YPMAXDOMAIN] = '\0';
 
   ysd->dom_socket = RPC_ANYSOCK;
-#ifdef SOCK_CLOEXEC
-# define xflags SOCK_CLOEXEC
-#else
-# define xflags 0
-#endif
   ysd->dom_client = __libc_clntudp_bufcreate (&ysd->dom_server_addr, YPPROG,
 					      YPVERS, UDPTIMEOUT,
 					      &ysd->dom_socket,
 					      UDPMSGSIZE, UDPMSGSIZE,
-					      xflags);
-
-  if (ysd->dom_client != NULL)
-    {
-#ifndef SOCK_CLOEXEC
-      /* If the program exits, close the socket */
-      if (fcntl (ysd->dom_socket, F_SETFD, FD_CLOEXEC) == -1)
-	perror ("fcntl: F_SETFD");
-#endif
-    }
+					      SOCK_CLOEXEC);
 }
 
 #if USE_BINDINGDIR