File: git-recvmsg.diff

package info (click to toggle)
glibc 2.24-11%2Bdeb9u3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 225,316 kB
  • sloc: ansic: 996,116; asm: 261,826; sh: 10,483; makefile: 9,849; cpp: 4,169; python: 3,971; perl: 2,254; awk: 1,753; pascal: 1,521; yacc: 291; sed: 80
file content (33 lines) | stat: -rw-r--r-- 1,171 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
commit a194625ef31f0c33afae9b53e2dfaa17c2517606
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Tue Aug 9 01:42:50 2016 +0200

    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.

diff --git a/sysdeps/mach/hurd/recvmsg.c b/sysdeps/mach/hurd/recvmsg.c
index 770a42e..51cfbd7 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);