File tree 1 file changed +4
-3
lines changed
library/std/src/sys/unix/process
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -698,11 +698,12 @@ impl Command {
698
698
699
699
msg. msg_iov = & mut iov as * mut _ as * mut _ ;
700
700
msg. msg_iovlen = 1 ;
701
- msg. msg_controllen = mem:: size_of_val ( & cmsg. buf ) as _ ;
702
- msg. msg_control = & mut cmsg. buf as * mut _ as * mut _ ;
703
701
704
702
// only attach cmsg if we successfully acquired the pidfd
705
703
if pidfd >= 0 {
704
+ msg. msg_controllen = mem:: size_of_val ( & cmsg. buf ) as _ ;
705
+ msg. msg_control = & mut cmsg. buf as * mut _ as * mut _ ;
706
+
706
707
let hdr = CMSG_FIRSTHDR ( & mut msg as * mut _ as * mut _ ) ;
707
708
( * hdr) . cmsg_level = SOL_SOCKET ;
708
709
( * hdr) . cmsg_type = SCM_RIGHTS ;
@@ -719,7 +720,7 @@ impl Command {
719
720
// so we get a consistent SEQPACKET order
720
721
match cvt_r ( || libc:: sendmsg ( sock. as_raw ( ) , & msg, 0 ) ) {
721
722
Ok ( 0 ) => { }
722
- _ => rtabort ! ( "failed to communicate with parent process" ) ,
723
+ other => rtabort ! ( "failed to communicate with parent process. {:?}" , other ) ,
723
724
}
724
725
}
725
726
}
You can’t perform that action at this time.
0 commit comments