From 9d067269f5c3ecc5913e7e424a4778608d784731 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Mon, 13 Mar 2017 20:41:12 +0100 Subject: 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. --- sysdeps/mach/hurd/send.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sysdeps/mach/hurd/send.c') 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) -- cgit 1.4.1