[CRIU] [PATCH 2/2] scm: common -- Hide struct fd_opts argument

Cyrill Gorcunov gorcunov at openvz.org
Mon Nov 14 06:02:42 PST 2016


When SCM_FDSET_HAS_OPTS is not set the scm-code.c
can't be built because it declares struct fd_opts
in parameters. Lets rather hide this type and
allow to build without SCM_FDSET_HAS_OPTS definition.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 include/common/scm-code.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/common/scm-code.c b/include/common/scm-code.c
index 015ca564321c..20865b08fe30 100644
--- a/include/common/scm-code.c
+++ b/include/common/scm-code.c
@@ -9,9 +9,11 @@
 #ifdef SCM_FDSET_HAS_OPTS
 #define OPTS_LEN(_flags, _nr)	(_flags ? sizeof(struct fd_opts) * (_nr) : 1)
 #define OPTS_BUF(_fdset)	((_fdset)->opts)
+#define FD_OPTS_PTR		struct fd_opts *
 #else
 #define OPTS_LEN(_flags, _nr)	(1)
 #define OPTS_BUF(_fdset)	(&(_fdset)->dummy)
+#define FD_OPTS_PTR		char *
 #endif
 
 static void scm_fdset_init_chunk(struct scm_fdset *fdset, int nr_fds, bool with_flags)
@@ -118,7 +120,7 @@ int send_fds(int sock, struct sockaddr_un *saddr, int len,
 	return 0;
 }
 
-int recv_fds(int sock, int *fds, int nr_fds, struct fd_opts *opts)
+int recv_fds(int sock, int *fds, int nr_fds, FD_OPTS_PTR opts)
 {
 	struct scm_fdset fdset;
 	struct cmsghdr *cmsg;
-- 
2.7.4



More information about the CRIU mailing list