summaryrefslogtreecommitdiff
path: root/sysdeps/mach/hurd/send.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2017-03-13 20:41:12 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2017-03-13 20:41:12 +0100
commit9d067269f5c3ecc5913e7e424a4778608d784731 (patch)
treec561c33582a593249173f8923be0c56d871c7c0c /sysdeps/mach/hurd/send.c
parentc89721e25d609ec4f3366a3956b2f3e5acd76e77 (diff)
downloadglibc-9d067269f5c3ecc5913e7e424a4778608d784731.tar.gz
hurd: Make send/recv more posixish
Thanks David Michael for the suggestion. * sysdeps/mach/hurd/send.c (__send): Convert hurdish error code into posix error code. * sysdeps/mach/hurd/recv.c (__recv): Likewise.
Diffstat (limited to 'sysdeps/mach/hurd/send.c')
-rw-r--r--sysdeps/mach/hurd/send.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sysdeps/mach/hurd/send.c b/sysdeps/mach/hurd/send.c
index 8eb97e99ee..98ffcbf562 100644
--- a/sysdeps/mach/hurd/send.c
+++ b/sysdeps/mach/hurd/send.c
@@ -33,6 +33,10 @@ __send (int fd, const void *buf, size_t n, int flags)
NULL, MACH_MSG_TYPE_COPY_SEND, 0,
NULL, 0, &wrote));
+ if (err == MIG_BAD_ID || err == EOPNOTSUPP)
+ /* The file did not grok the socket protocol. */
+ err = ENOTSOCK;
+
return err ? __hurd_sockfail (fd, flags, err) : wrote;
}
libc_hidden_def (__send)