[CRIU] Re: [PATCH 6/6] util-net: Make send_fd/recv_fd being a particular case of send_fds/recv_fds

Cyrill Gorcunov gorcunov at openvz.org
Wed Mar 21 03:55:11 EDT 2012


On Wed, Mar 21, 2012 at 11:47:57AM +0400, Cyrill Gorcunov wrote:
> The send_fd/recv_fd do transfer single file descriptor
> which is a particular case of transferring multiple
> descriptors, so make them being a wrappers over
> send_fds/revc_fds to not duplicate the code.
> 
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> --- a/util-net.c
> +++ b/util-net.c
> @@ -39,11 +39,10 @@ static void scm_fdset_init(struct scm_fdset *fdset, struct sockaddr_un *saddr, i
>  	fdset->iov.iov_base		= &fdset->__pad;
>  	fdset->iov.iov_len		= sizeof(fdset->__pad);
>  
> -	/*
> -	 * msg_name and msg_namelen should be assigned separately.
> -	 */
>  	fdset->hdr.msg_iov		= &fdset->iov;
>  	fdset->hdr.msg_iovlen		= 1;
> +	fdset->hdr.msg_name		= (struct sockaddr *)saddr;
> +	fdset->hdr.msg_namelen		= saddr_len;
>  

Sigh, this snippet should be in previous patch. Pavel, this is not
really important because the send_fds/recv_fds is never used before
this patch so we're on safe side anyway, but if you prefer -- I'll
update the series and send you new pull request.

	Cyrill


More information about the CRIU mailing list