about summary refs log tree commit diff
path: root/nis/ypclnt.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-03-21 00:43:13 +0000
committerUlrich Drepper <drepper@redhat.com>2002-03-21 00:43:13 +0000
commit85939c79373c22703af2f438824f77727d60fbb4 (patch)
treec8847e97f8d675c3355741324a59952e661d59c4 /nis/ypclnt.c
parentcb50c2187f0eba31b0799fa692dfd749dfd52142 (diff)
downloadglibc-85939c79373c22703af2f438824f77727d60fbb4.tar.gz
glibc-85939c79373c22703af2f438824f77727d60fbb4.tar.xz
glibc-85939c79373c22703af2f438824f77727d60fbb4.zip
(yp_all): Remove the hack introduced on 1998-09-29. Correctly close the UDP connection right away.
Diffstat (limited to 'nis/ypclnt.c')
-rw-r--r--nis/ypclnt.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/nis/ypclnt.c b/nis/ypclnt.c
index 6dfdf8600d..7123f636bf 100644
--- a/nis/ypclnt.c
+++ b/nis/ypclnt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2001, 2002 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Thorsten Kukuk <kukuk@suse.de>, 1996.
 
@@ -704,16 +704,16 @@ yp_all (const char *indomain, const char *inmap,
 	  return YPERR_DOMAIN;
 	}
 
-      /* YPPROC_ALL get its own TCP channel to ypserv.  Therefore we
-	 close the socket opened by the __yp_bind call.  */
-      close (ydb->dom_socket);
       clnt_sock = RPC_ANYSOCK;
       clnt_sin = ydb->dom_server_addr;
       clnt_sin.sin_port = 0;
+
+      /* We don't need the UDP connection anymore.  */
+      __yp_unbind (ydb);
+
       clnt = clnttcp_create (&clnt_sin, YPPROG, YPVERS, &clnt_sock, 0, 0);
       if (clnt == NULL)
 	{
-	  __yp_unbind (ydb);
 	  __set_errno (saved_errno);
 	  return YPERR_PMAP;
 	}
@@ -737,7 +737,6 @@ yp_all (const char *indomain, const char *inmap,
       else
 	res = YPERR_SUCCESS;
 
-      __yp_unbind (ydb);
       clnt_destroy (clnt);
 
       if (res == YPERR_SUCCESS && status != YP_NOMORE)