Commit ed4a4b75 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

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: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 3c982617
...@@ -15,26 +15,6 @@ ...@@ -15,26 +15,6 @@
#include "common/scm.h" #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); extern int open_detach_mount(char *dir);
#endif /* __CR_UTIL_NET_H__ */ #endif /* __CR_UTIL_NET_H__ */
...@@ -52,4 +52,20 @@ extern int recv_fds(int sock, int *fds, int nr_fds, struct fd_opts *opts); ...@@ -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); extern int recv_fds(int sock, int *fds, int nr_fds, char *opts);
#endif #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 #endif
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