[CRIU] Re: [PATCH 6/6] util-net: Make send_fd/recv_fd being a
particular case of send_fds/recv_fds
Pavel Emelyanov
xemul at parallels.com
Wed Mar 21 06:39:04 EDT 2012
On 03/21/2012 12:10 PM, Cyrill Gorcunov wrote:
> 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>
>> ---
>
> Updated version enveloped.
>
> Cyrill
> +static int send_fd(int sock, struct sockaddr_un *saddr, int saddr_len, int fd)
> +{
> + return send_fds(sock, saddr, saddr_len, &fd, 1);
> +}
> +
> +static int recv_fd(int sock)
> +{
> + int fd, ret;
> +
> + ret = recv_fds(sock, &fd, 1);
> + if (ret)
> + return -1;
> +
> + return fd;
> +}
They both should be inline.
More information about the CRIU
mailing list