!36 lxc: fix build test error
Merge pull request !36 from lifeng_isula/master
This commit is contained in:
commit
9bc220e133
65
0066-lxc-fix-tests-build-error.patch
Normal file
65
0066-lxc-fix-tests-build-error.patch
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
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
|
||||||
|
|
||||||
3
lxc.spec
3
lxc.spec
@ -1,4 +1,4 @@
|
|||||||
%global _release 2020051401
|
%global _release 2020051901
|
||||||
%global debug_package %{nil}
|
%global debug_package %{nil}
|
||||||
|
|
||||||
Name: lxc
|
Name: lxc
|
||||||
@ -73,6 +73,7 @@ Patch9061: 0062-change-log-level-of-seccomp-setup.patch
|
|||||||
Patch9062: 0063-hook-fix-memeory-leak.patch
|
Patch9062: 0063-hook-fix-memeory-leak.patch
|
||||||
Patch9063: 0064-termainal-fix-console-log-memory-leak.patch
|
Patch9063: 0064-termainal-fix-console-log-memory-leak.patch
|
||||||
Patch9064: 0065-lxc-disable-terminal-stdout-stderr-pipe-O_NONBLOCK.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: systemd-units git libtool graphviz docbook2X doxygen chrpath
|
||||||
BuildRequires: pkgconfig(libseccomp)
|
BuildRequires: pkgconfig(libseccomp)
|
||||||
|
|||||||
@ -63,3 +63,4 @@
|
|||||||
0063-hook-fix-memeory-leak.patch
|
0063-hook-fix-memeory-leak.patch
|
||||||
0064-termainal-fix-console-log-memory-leak.patch
|
0064-termainal-fix-console-log-memory-leak.patch
|
||||||
0065-lxc-disable-terminal-stdout-stderr-pipe-O_NONBLOCK.patch
|
0065-lxc-disable-terminal-stdout-stderr-pipe-O_NONBLOCK.patch
|
||||||
|
0066-lxc-fix-tests-build-error.patch
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user