summaryrefslogtreecommitdiff
path: root/sysdeps/mach/hurd/recv.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/mach/hurd/recv.c')
-rw-r--r--sysdeps/mach/hurd/recv.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sysdeps/mach/hurd/recv.c b/sysdeps/mach/hurd/recv.c
index 1534228c0a..0bc5ce4bfc 100644
--- a/sysdeps/mach/hurd/recv.c
+++ b/sysdeps/mach/hurd/recv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1994-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
@@ -37,12 +37,16 @@ __recv (int fd, void *buf, size_t n, int flags)
char *cdata = NULL;
mach_msg_type_number_t clen = 0;
- if (err = HURD_DPORT_USE (fd, __socket_recv (port, &addrport,
+ err = HURD_DPORT_USE (fd, __socket_recv (port, &addrport,
flags, &bufp, &nread,
&ports, &nports,
&cdata, &clen,
&flags,
- n)))
+ n));
+ if (err == MIG_BAD_ID || err == EOPNOTSUPP)
+ /* The file did not grok the socket protocol. */
+ err = ENOTSOCK;
+ if (err)
return __hurd_sockfail (fd, flags, err);
__mach_port_deallocate (__mach_task_self (), addrport);