66 lines
1.7 KiB
Diff
66 lines
1.7 KiB
Diff
|
|
From 0bd5b0420aba3a8fb20c686db49a842a7a1eee4f Mon Sep 17 00:00:00 2001
|
||
|
|
From: lifeng68 <lifeng68@huawei.com>
|
||
|
|
Date: Tue, 19 May 2020 06:25:10 -0400
|
||
|
|
Subject: [PATCH] lxc: fix tests build error
|
||
|
|
|
||
|
|
Signed-off-by: lifeng68 <lifeng68@huawei.com>
|
||
|
|
---
|
||
|
|
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 <lxc/lxccontainer.h>
|
||
|
|
|
||
|
|
@@ -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
|
||
|
|
|