about summary refs log tree commit diff
path: root/sysdeps/mach/hurd/bind.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1995-10-16 07:29:08 +0000
committerRoland McGrath <roland@gnu.org>1995-10-16 07:29:08 +0000
commit924b9ff68db26697e50a298c3ae12159de259c2f (patch)
tree2374009a4bcd22360f0380b4974255461ab660fa /sysdeps/mach/hurd/bind.c
parent2948fc64a6dd7aa23757daf2c5256dfe07f4c61a (diff)
downloadglibc-924b9ff68db26697e50a298c3ae12159de259c2f.tar.gz
glibc-924b9ff68db26697e50a298c3ae12159de259c2f.tar.xz
glibc-924b9ff68db26697e50a298c3ae12159de259c2f.zip
Mon Oct 16 03:22:37 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu> cvs/libc-951016
	* sysdeps/mach/hurd/getcwd.c: Use __file_name_lookup_under.
	* sysdeps/mach/hurd/bind.c: Likewise.
	* sysdeps/mach/hurd/access.c: Use new __hurd_file_name_lookup
	calling convention.

	* hurd/hurdexec.c: Undo last change (10 Oct 95).
Diffstat (limited to 'sysdeps/mach/hurd/bind.c')
-rw-r--r--sysdeps/mach/hurd/bind.c34
1 files changed, 8 insertions, 26 deletions
diff --git a/sysdeps/mach/hurd/bind.c b/sysdeps/mach/hurd/bind.c
index 2e3f5bfb36..907f445751 100644
--- a/sysdeps/mach/hurd/bind.c
+++ b/sysdeps/mach/hurd/bind.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1994 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -65,40 +65,22 @@ DEFUN(bind, (fd, addr, len),
 	  if (! err)
 	    /* Link the node, now a socket, into the target directory.  */
 	    err = __dir_link (node, dir, n);
+	  __mach_port_deallocate (__mach_task_self (), node);
 	  if (! err)
-	    /* Get a port to the ifsock translator.  */
 	    {
-	      retry_type retry;
-	      string_t retry_name;
-
-	      err = __dir_lookup (dir, n, 0, 0, &retry, retry_name, &ifsock);
-
-	      if (! err && (retry != FS_RETRY_NORMAL || retry_name[0]))
-		/* Either someone has fucked with our new node, or the ifsock
-		   translator is acting very oddly.  */
+	      /* Get a port to the ifsock translator.  */
+	      ifsock = __file_name_lookup_under (dir, n, 0, 0);
+	      if (ifsock == MACH_PORT_NULL)
 		{
-		  struct hurd_userlink crdir_ulink;
-		  file_t crdir =
-		    _hurd_port_get (&_hurd_ports[INIT_PORT_CRDIR],
-				    &crdir_ulink);
-
-		  err = __hurd_file_name_lookup_retry (crdir,
-						       retry, retry_name, 0, 0,
-						       &ifsock);
-
-		  _hurd_port_free (&_hurd_ports[INIT_PORT_CRDIR],
-				   &crdir_ulink, crdir);
+		  err = errno;
+		  /* If we failed, get rid of the node we created.  */
+		  __dir_unlink (dir, n);
 		}
-
-	      if (err)
-		/* If we failed, get rid of the node we created.  */
-		__dir_unlink  (dir, n);
 	    }
 	  if (! err)
 	    /* Get the address port.  */
 	    err = __ifsock_getsockaddr (ifsock, &aport);
 	  __mach_port_deallocate (__mach_task_self (), ifsock);
-	  __mach_port_deallocate (__mach_task_self (), node);
 	}
       __mach_port_deallocate (__mach_task_self (), dir);