File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -758,13 +758,16 @@ send_pid_on_socket (int sockfd)
758
758
struct msghdr msg = {};
759
759
struct iovec iov = { buf , sizeof (buf ) };
760
760
const ssize_t control_len_snd = CMSG_SPACE (sizeof (struct ucred ));
761
- char control_buf_snd [control_len_snd ];
761
+ union {
762
+ char buf [control_len_snd ];
763
+ struct cmsghdr align ;
764
+ } control_buf_snd ;
762
765
struct cmsghdr * cmsg ;
763
766
struct ucred cred ;
764
767
765
768
msg .msg_iov = & iov ;
766
769
msg .msg_iovlen = 1 ;
767
- msg .msg_control = control_buf_snd ;
770
+ msg .msg_control = control_buf_snd . buf ;
768
771
msg .msg_controllen = control_len_snd ;
769
772
770
773
cmsg = CMSG_FIRSTHDR (& msg );
@@ -800,12 +803,15 @@ read_pid_from_socket (int sockfd)
800
803
struct msghdr msg = {};
801
804
struct iovec iov = { recv_buf , sizeof (recv_buf ) };
802
805
const ssize_t control_len_rcv = CMSG_SPACE (sizeof (struct ucred ));
803
- char control_buf_rcv [control_len_rcv ];
806
+ union {
807
+ char buf [control_len_rcv ];
808
+ struct cmsghdr align ;
809
+ } control_buf_rcv ;
804
810
struct cmsghdr * cmsg ;
805
811
806
812
msg .msg_iov = & iov ;
807
813
msg .msg_iovlen = 1 ;
808
- msg .msg_control = control_buf_rcv ;
814
+ msg .msg_control = control_buf_rcv . buf ;
809
815
msg .msg_controllen = control_len_rcv ;
810
816
811
817
if (TEMP_FAILURE_RETRY (recvmsg (sockfd , & msg , 0 )) < 0 )
You can’t perform that action at this time.
0 commit comments