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.
This commit is contained in:
Samuel Thibault 2017-03-13 20:41:12 +01:00
parent c89721e25d
commit 9d067269f5
3 changed files with 16 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2017-03-13 Samuel Thibault <samuel.thibault@ens-lyon.org>
* sysdeps/mach/hurd/send.c (__send): Convert hurdish error code into
posix error code.
* sysdeps/mach/hurd/recv.c (__recv): Likewise.
2017-03-13 Adhemerval Zanella <adhemerval.zanella@linaro.org>
* scripts/build-many-glibcs.py (Context.add_all_configs): Remove

View File

@ -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);

View File

@ -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)