summary refs log tree commit diff
path: root/sysdeps/mach/hurd
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2016-08-09 01:42:50 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2016-08-09 01:42:50 +0200
commita194625ef31f0c33afae9b53e2dfaa17c2517606 (patch)
tree19605f12524ac535a3086297f4db05b6aec85445 /sysdeps/mach/hurd
parentbf79a337ec86c2530edd26f4270f9688bf428ea2 (diff)
downloadglibc-a194625ef31f0c33afae9b53e2dfaa17c2517606.tar.gz
glibc-a194625ef31f0c33afae9b53e2dfaa17c2517606.tar.xz
glibc-a194625ef31f0c33afae9b53e2dfaa17c2517606.zip
Fix recvmsg returning SIGLOST on PF_LOCAL sockets
when msg_name is not NULL.

	* sysdeps/mach/hurd/recvmsg.c (__libc_recvmsg): Cope with aport being
	MACH_PORT_NULL.
Diffstat (limited to 'sysdeps/mach/hurd')
-rw-r--r--sysdeps/mach/hurd/recvmsg.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sysdeps/mach/hurd/recvmsg.c b/sysdeps/mach/hurd/recvmsg.c
index 770a42e05e..51cfbd7cdb 100644
--- a/sysdeps/mach/hurd/recvmsg.c
+++ b/sysdeps/mach/hurd/recvmsg.c
@@ -64,7 +64,7 @@ __libc_recvmsg (int fd, struct msghdr *message, int flags)
 					       &message->msg_flags, amount)))
     return __hurd_sockfail (fd, flags, err);
 
-  if (message->msg_name != NULL)
+  if (message->msg_name != NULL && aport != MACH_PORT_NULL)
     {
       char *buf = message->msg_name;
       mach_msg_type_number_t buflen = message->msg_namelen;
@@ -98,6 +98,8 @@ __libc_recvmsg (int fd, struct msghdr *message, int flags)
       if (buflen > 0)
 	((struct sockaddr *) message->msg_name)->sa_family = type;
     }
+  else if (message->msg_name != NULL)
+    message->msg_namelen = 0;
 
   __mach_port_deallocate (__mach_task_self (), aport);