Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/checkpoint-restore/criu.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@openvz.org>2016-11-15 12:42:00 +0300
committerPavel Emelyanov <xemul@virtuozzo.com>2016-12-12 16:22:19 +0300
commited4a4b75078aa89be77aad43948e310c6329fc5e (patch)
treec07526d093110766b47663c5e7cc0abcf4547ba3 /include
parent3c982617304b23af3f2503b5b0e2d89b11f07059 (diff)
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>
Diffstat (limited to 'include')
-rw-r--r--include/common/scm.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/common/scm.h b/include/common/scm.h
index 144d96049..f7bc5e6f3 100644
--- a/include/common/scm.h
+++ b/include/common/scm.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