diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2017-03-14 00:39:26 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2017-03-14 00:39:26 +0100 |
commit | 2c7242b971fd7b63fa842df15ec6fa3d0ff8aeb0 (patch) | |
tree | 6049f3758852796262a12f9bf9b819f8ef33ff90 | |
parent | 6bc46c60ba9ef9663fb179339d6e67920d71b392 (diff) | |
parent | b12af7e807488f3c955f6eceea75c6f23f39f06d (diff) |
Merge commit 'refs/top-bases/t/____longjmp_chk' into t/____longjmp_chk
-rw-r--r-- | sysdeps/mach/hurd/recv.c | 8 | ||||
-rw-r--r-- | sysdeps/mach/hurd/send.c | 4 |
2 files changed, 10 insertions, 2 deletions
diff --git a/sysdeps/mach/hurd/recv.c b/sysdeps/mach/hurd/recv.c index 1534228c0a..d75cf665ba 100644 --- a/sysdeps/mach/hurd/recv.c +++ b/sysdeps/mach/hurd/recv.c @@ -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); diff --git a/sysdeps/mach/hurd/send.c b/sysdeps/mach/hurd/send.c index cc7d2a8b86..3bcd749c15 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) |