From eaf7887f008d4a7cfed1c2f0fecd242402b1a335 Mon Sep 17 00:00:00 2001 From: lifeng68 Date: Tue, 19 May 2020 06:33:44 -0400 Subject: [PATCH] lxc: fix build test error Signed-off-by: lifeng68 --- 0066-lxc-fix-tests-build-error.patch | 65 ++++++++++++++++++++++++++++ lxc.spec | 3 +- series.conf | 1 + 3 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 0066-lxc-fix-tests-build-error.patch diff --git a/0066-lxc-fix-tests-build-error.patch b/0066-lxc-fix-tests-build-error.patch new file mode 100644 index 0000000..dd19a67 --- /dev/null +++ b/0066-lxc-fix-tests-build-error.patch @@ -0,0 +1,65 @@ +From 0bd5b0420aba3a8fb20c686db49a842a7a1eee4f Mon Sep 17 00:00:00 2001 +From: lifeng68 +Date: Tue, 19 May 2020 06:25:10 -0400 +Subject: [PATCH] lxc: fix tests build error + +Signed-off-by: lifeng68 +--- + src/tests/Makefile.am | 4 ++++ + src/tests/attach.c | 9 +++++++++ + 2 files changed, 13 insertions(+) + +diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am +index 493b33c9d..59905d326 100644 +--- a/src/tests/Makefile.am ++++ b/src/tests/Makefile.am +@@ -58,6 +58,10 @@ AM_CFLAGS=-DLXCROOTFSMOUNT=\"$(LXCROOTFSMOUNT)\" \ + -I $(top_srcdir)/src/lxc/tools \ + -pthread + ++if HAVE_ISULAD ++AM_CFLAGS += -I $(top_srcdir)/src/lxc/json ++endif ++ + if ENABLE_APPARMOR + AM_CFLAGS += -DHAVE_APPARMOR + endif +diff --git a/src/tests/attach.c b/src/tests/attach.c +index 07e641d56..acb4c89f4 100644 +--- a/src/tests/attach.c ++++ b/src/tests/attach.c +@@ -29,6 +29,7 @@ + #include "lxctest.h" + #include "utils.h" + #include "lsm/lsm.h" ++#include "config.h" + + #include + +@@ -76,7 +77,11 @@ static void test_attach_lsm_set_config(struct lxc_container *ct) + ct->save_config(ct, NULL); + } + ++#ifdef HAVE_ISULAD ++static int test_attach_lsm_func_func(void* payload, int fd) ++#else + static int test_attach_lsm_func_func(void* payload) ++#endif + { + TSTOUT("%s", lsm_process_label_get(syscall(SYS_getpid))); + return 0; +@@ -187,7 +192,11 @@ static int test_attach_lsm_func(struct lxc_container *ct) { return 0; } + static int test_attach_lsm_cmd(struct lxc_container *ct) { return 0; } + #endif /* HAVE_APPARMOR || HAVE_SELINUX */ + ++#ifdef HAVE_ISULAD ++static int test_attach_func_func(void* payload, int fd) ++#else + static int test_attach_func_func(void* payload) ++#endif + { + TSTOUT("%d", (int)syscall(SYS_getpid)); + return 0; +-- +2.18.2 + diff --git a/lxc.spec b/lxc.spec index 2781114..a406b49 100644 --- a/lxc.spec +++ b/lxc.spec @@ -1,4 +1,4 @@ -%global _release 2020051401 +%global _release 2020051901 %global debug_package %{nil} Name: lxc @@ -73,6 +73,7 @@ Patch9061: 0062-change-log-level-of-seccomp-setup.patch Patch9062: 0063-hook-fix-memeory-leak.patch Patch9063: 0064-termainal-fix-console-log-memory-leak.patch Patch9064: 0065-lxc-disable-terminal-stdout-stderr-pipe-O_NONBLOCK.patch +Patch9065: 0066-lxc-fix-tests-build-error.patch BuildRequires: systemd-units git libtool graphviz docbook2X doxygen chrpath BuildRequires: pkgconfig(libseccomp) diff --git a/series.conf b/series.conf index c91479b..84084ad 100644 --- a/series.conf +++ b/series.conf @@ -63,3 +63,4 @@ 0063-hook-fix-memeory-leak.patch 0064-termainal-fix-console-log-memory-leak.patch 0065-lxc-disable-terminal-stdout-stderr-pipe-O_NONBLOCK.patch +0066-lxc-fix-tests-build-error.patch -- Gitee