[CRIU] Re: [PATCH 5/6] util-net: Add send_fds and recv_fds

Cyrill Gorcunov gorcunov at openvz.org
Wed Mar 21 06:56:55 EDT 2012


On Wed, Mar 21, 2012 at 02:38:43PM +0400, Pavel Emelyanov wrote:
...
> 
> Ugly. Rename this int __pad into char msg and leave a comment saying that
> we need to send at least one byte.

ok on all concerns.

> > +	cmsg				= CMSG_FIRSTHDR(&fdset->hdr);
> > +	cmsg->cmsg_len			= fdset->hdr.msg_controllen;
> > +	cmsg->cmsg_level		= SOL_SOCKET;
> > +	cmsg->cmsg_type			= SCM_RIGHTS;
> 
> These tree are re-set by scm_fdset_update every loop cycle. No need in doing it here.
> 

ok

> > +
> > +int send_fds(int sock, struct sockaddr_un *saddr, int saddr_len, int *fds, int nr_fds)
> > +{
> > +	struct scm_fdset fdset;
> > +	int *__fds_tx;
> 
> What are __-s for?

Will drop.

> 
> > +	int i, j, ret;
> > +
> > +	scm_fdset_init(&fdset, saddr, saddr_len);
> > +
> > +	__fds_tx = scm_fdset_first(&fdset);
> 
> Make init return pointer to fd array. No separate call here.
> 

OK

	Cyrill


More information about the CRIU mailing list