mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
scm: Unweave fds mess
Currently criu built with criu/pie-util-fd (which is a symlink to criu/pie/util-fd) with same flags as we use in general compel infection code. Moreover the criu link with libcompel.a, so we get a problem where send_fds/recv_fds are multiple defined. Lets rather unweave this mess: - drop criu/pie-util-fd.c completely - move send_fd/recv_fd inliners into scm.h Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
parent
3c98261730
commit
ed4a4b7507
2 changed files with 16 additions and 20 deletions
|
|
@ -15,26 +15,6 @@
|
|||
|
||||
#include "common/scm.h"
|
||||
|
||||
extern int send_fds(int sock, struct sockaddr_un *saddr, int saddr_len,
|
||||
int *fds, int nr_fds, bool with_flags);
|
||||
extern int recv_fds(int sock, int *fds, int nr_fds, struct fd_opts *opts);
|
||||
|
||||
static inline int send_fd(int sock, struct sockaddr_un *saddr, int saddr_len, int fd)
|
||||
{
|
||||
return send_fds(sock, saddr, saddr_len, &fd, 1, false);
|
||||
}
|
||||
|
||||
static inline int recv_fd(int sock)
|
||||
{
|
||||
int fd, ret;
|
||||
|
||||
ret = recv_fds(sock, &fd, 1, NULL);
|
||||
if (ret)
|
||||
return -1;
|
||||
|
||||
return fd;
|
||||
}
|
||||
|
||||
extern int open_detach_mount(char *dir);
|
||||
|
||||
#endif /* __CR_UTIL_NET_H__ */
|
||||
|
|
|
|||
|
|
@ -52,4 +52,20 @@ extern int recv_fds(int sock, int *fds, int nr_fds, struct fd_opts *opts);
|
|||
extern int recv_fds(int sock, int *fds, int nr_fds, char *opts);
|
||||
#endif
|
||||
|
||||
static inline int send_fd(int sock, struct sockaddr_un *saddr, int saddr_len, int fd)
|
||||
{
|
||||
return send_fds(sock, saddr, saddr_len, &fd, 1, false);
|
||||
}
|
||||
|
||||
static inline int recv_fd(int sock)
|
||||
{
|
||||
int fd, ret;
|
||||
|
||||
ret = recv_fds(sock, &fd, 1, NULL);
|
||||
if (ret)
|
||||
return -1;
|
||||
|
||||
return fd;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue