Commit a5752133 authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by Andrei Vagin

compel: Add recv fd helper

The same for libcompel.so user.
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 6794c8c2
......@@ -2,4 +2,5 @@
#define __COMPEL_INFECT_UTIL_H__
struct parasite_ctl;
extern int compel_util_send_fd(struct parasite_ctl *ctl, int fd);
extern int compel_util_recv_fd(struct parasite_ctl *ctl, int *pfd);
#endif
......@@ -19,3 +19,14 @@ int compel_util_send_fd(struct parasite_ctl *ctl, int fd)
return 0;
}
int compel_util_recv_fd(struct parasite_ctl *ctl, int *pfd)
{
int sk;
sk = compel_rpc_sock(ctl);
if ((*pfd = recv_fd(sk)) < 0) {
pr_perror("Can't send file descriptor");
return -1;
}
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment