mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
compel: Add recv fd helper
The same for libcompel.so user. Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
parent
6794c8c2a9
commit
a5752133c7
2 changed files with 12 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue