/* _hurd_socket_server - Find the server for a socket domain.
- Copyright (C) 1991,92,93,94,95,97,99 Free Software Foundation, Inc.
+ Copyright (C) 1991-2018 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#include <hurd.h>
#include <sys/socket.h>
#include <string.h>
#include <hurd/paths.h>
#include <stdio.h>
-#include "stdio-common/_itoa.h"
+#include <_itoa.h>
#include <cthreads.h> /* For `struct mutex'. */
#include "hurdmalloc.h" /* XXX */
{
socket_t server;
+ if (domain < 0)
+ {
+ errno = EAFNOSUPPORT;
+ return MACH_PORT_NULL;
+ }
+
HURD_CRITICAL_BEGIN;
__mutex_lock (&lock);
if (server == MACH_PORT_NULL && errno == ENOENT)
/* If the server node is absent, we don't support that protocol. */
- errno = EPFNOSUPPORT;
+ errno = EAFNOSUPPORT;
__mutex_unlock (&lock);
HURD_CRITICAL_END;