[CRIU] [PATCH 4/4] include/common: Move bug.h in
Cyrill Gorcunov
gorcunov at openvz.org
Fri Oct 21 04:51:25 PDT 2016
Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
criu/action-scripts.c | 2 +-
criu/arch/aarch64/vdso-pie.c | 2 +-
criu/arch/ppc64/vdso-pie.c | 2 +-
criu/arch/x86/include/asm/types.h | 3 ++-
criu/arch/x86/vdso-pie.c | 2 +-
criu/bfd.c | 2 +-
criu/cgroup-props.c | 2 +-
criu/include/image.h | 3 ++-
criu/include/imgset.h | 3 ++-
criu/include/util.h | 2 +-
criu/path.c | 3 ++-
criu/pie/parasite-vdso.c | 2 +-
criu/pie/pie-relocs.c | 4 +++-
criu/pie/util-fd.c | 2 +-
criu/pie/util-vdso.c | 2 +-
criu/rst-malloc.c | 3 ++-
criu/timerfd.c | 2 +-
{criu/include => include/common}/bug.h | 4 +++-
18 files changed, 27 insertions(+), 18 deletions(-)
rename {criu/include => include/common}/bug.h (92%)
diff --git a/criu/action-scripts.c b/criu/action-scripts.c
index 99662b46e3f4..e9260f7a1ac2 100644
--- a/criu/action-scripts.c
+++ b/criu/action-scripts.c
@@ -11,7 +11,7 @@
#include "cr-service.h"
#include "action-scripts.h"
#include "pstree.h"
-#include "bug.h"
+#include "common/bug.h"
static const char *action_names[ACT_MAX] = {
[ ACT_PRE_DUMP ] = "pre-dump",
diff --git a/criu/arch/aarch64/vdso-pie.c b/criu/arch/aarch64/vdso-pie.c
index 6967b5cf644c..686b7f461f1d 100644
--- a/criu/arch/aarch64/vdso-pie.c
+++ b/criu/arch/aarch64/vdso-pie.c
@@ -6,7 +6,7 @@
#include "uapi/std/syscall.h"
#include "parasite-vdso.h"
#include "log.h"
-#include "bug.h"
+#include "common/bug.h"
#ifdef LOG_PREFIX
# undef LOG_PREFIX
diff --git a/criu/arch/ppc64/vdso-pie.c b/criu/arch/ppc64/vdso-pie.c
index b3994f11e0d0..58768ab8a00f 100644
--- a/criu/arch/ppc64/vdso-pie.c
+++ b/criu/arch/ppc64/vdso-pie.c
@@ -6,7 +6,7 @@
#include "uapi/std/syscall.h"
#include "parasite-vdso.h"
#include "log.h"
-#include "bug.h"
+#include "common/bug.h"
#ifdef LOG_PREFIX
# undef LOG_PREFIX
diff --git a/criu/arch/x86/include/asm/types.h b/criu/arch/x86/include/asm/types.h
index fef94f3c1855..f9ec569dc0a4 100644
--- a/criu/arch/x86/include/asm/types.h
+++ b/criu/arch/x86/include/asm/types.h
@@ -10,7 +10,8 @@
#include "uapi/std/asm/syscall-types.h"
-#include "bug.h"
+#include "log.h"
+#include "common/bug.h"
#include "images/core.pb-c.h"
#define SIGMAX 64
diff --git a/criu/arch/x86/vdso-pie.c b/criu/arch/x86/vdso-pie.c
index 1d27716c4da3..2e2041b3ac1a 100644
--- a/criu/arch/x86/vdso-pie.c
+++ b/criu/arch/x86/vdso-pie.c
@@ -6,7 +6,7 @@
#include "uapi/std/syscall.h"
#include "parasite-vdso.h"
#include "log.h"
-#include "bug.h"
+#include "common/bug.h"
#ifdef LOG_PREFIX
# undef LOG_PREFIX
diff --git a/criu/bfd.c b/criu/bfd.c
index dbdebd94bf91..8269ab1a25f0 100644
--- a/criu/bfd.c
+++ b/criu/bfd.c
@@ -8,8 +8,8 @@
#include <errno.h>
#include "int.h"
-#include "bug.h"
#include "log.h"
+#include "common/bug.h"
#include "bfd.h"
#include "common/list.h"
#include "util.h"
diff --git a/criu/cgroup-props.c b/criu/cgroup-props.c
index 938d7cecebd2..489801f3f3d8 100644
--- a/criu/cgroup-props.c
+++ b/criu/cgroup-props.c
@@ -18,7 +18,7 @@
#include "util.h"
#include "common/list.h"
#include "log.h"
-#include "bug.h"
+#include "common/bug.h"
#undef LOG_PREFIX
#define LOG_PREFIX "cg-prop: "
diff --git a/criu/include/image.h b/criu/include/image.h
index fc1cf893c6bd..1c22a4f66270 100644
--- a/criu/include/image.h
+++ b/criu/include/image.h
@@ -9,7 +9,8 @@
#include "fcntl.h"
#include "magic.h"
#include "bfd.h"
-#include "bug.h"
+#include "log.h"
+#include "common/bug.h"
#ifdef _ARCH_PPC64
#define PAGE_IMAGE_SIZE 65536
diff --git a/criu/include/imgset.h b/criu/include/imgset.h
index 04be917e2dac..02ad169df538 100644
--- a/criu/include/imgset.h
+++ b/criu/include/imgset.h
@@ -2,7 +2,8 @@
#define __CR_IMGSET_H__
#include "image-desc.h"
-#include "bug.h"
+#include "log.h"
+#include "common/bug.h"
#include "image.h"
struct cr_imgset {
diff --git a/criu/include/util.h b/criu/include/util.h
index 1504e5a042fa..ab2800f40311 100644
--- a/criu/include/util.h
+++ b/criu/include/util.h
@@ -14,7 +14,7 @@
#include "common/compiler.h"
#include "xmalloc.h"
-#include "bug.h"
+#include "common/bug.h"
#include "log.h"
#include "err.h"
diff --git a/criu/path.c b/criu/path.c
index 39da84b1825e..70b0c472c559 100644
--- a/criu/path.c
+++ b/criu/path.c
@@ -5,7 +5,8 @@
#include "int.h"
#include "mount.h"
#include "path.h"
-#include "bug.h"
+#include "log.h"
+#include "common/bug.h"
char *cut_root_for_bind(char *target_root, char *source_root)
{
diff --git a/criu/pie/parasite-vdso.c b/criu/pie/parasite-vdso.c
index d0bc2f782b46..bd94bf2ff12c 100644
--- a/criu/pie/parasite-vdso.c
+++ b/criu/pie/parasite-vdso.c
@@ -16,7 +16,7 @@
#include "parasite-vdso.h"
#include "vma.h"
#include "log.h"
-#include "bug.h"
+#include "common/bug.h"
#ifdef LOG_PREFIX
# undef LOG_PREFIX
diff --git a/criu/pie/pie-relocs.c b/criu/pie/pie-relocs.c
index b137581a8370..eac507b55266 100644
--- a/criu/pie/pie-relocs.c
+++ b/criu/pie/pie-relocs.c
@@ -14,9 +14,11 @@
#include "asm-generic/int.h"
+#include "log.h"
+
#include "common/compiler.h"
#include "compel/include/uapi/compel.h"
-#include "bug.h"
+#include "common/bug.h"
__maybe_unused void elf_relocs_apply(void *mem, void *vbase, size_t size, compel_reloc_t *elf_relocs, size_t nr_relocs)
{
diff --git a/criu/pie/util-fd.c b/criu/pie/util-fd.c
index 024381f24c04..51696eec2cba 100644
--- a/criu/pie/util-fd.c
+++ b/criu/pie/util-fd.c
@@ -19,7 +19,7 @@
#include "util-pie.h"
#include "fcntl.h"
-#include "bug.h"
+#include "common/bug.h"
static void scm_fdset_init_chunk(struct scm_fdset *fdset, int nr_fds)
{
diff --git a/criu/pie/util-vdso.c b/criu/pie/util-vdso.c
index 90e55a96b3c7..44e4b89646af 100644
--- a/criu/pie/util-vdso.c
+++ b/criu/pie/util-vdso.c
@@ -15,7 +15,7 @@
#include "util-vdso.h"
#include "vma.h"
#include "log.h"
-#include "bug.h"
+#include "common/bug.h"
#ifdef LOG_PREFIX
# undef LOG_PREFIX
diff --git a/criu/rst-malloc.c b/criu/rst-malloc.c
index 100b7f893a81..251ca2f17100 100644
--- a/criu/rst-malloc.c
+++ b/criu/rst-malloc.c
@@ -4,7 +4,8 @@
#include "page.h"
#include "rst-malloc.h"
-#include "bug.h"
+#include "log.h"
+#include "common/bug.h"
struct rst_mem_type_s {
bool remapable;
diff --git a/criu/timerfd.c b/criu/timerfd.c
index 3ff9daec9e7f..72635e75bb35 100644
--- a/criu/timerfd.c
+++ b/criu/timerfd.c
@@ -19,7 +19,7 @@
#include "imgset.h"
#include "util.h"
#include "log.h"
-#include "bug.h"
+#include "common/bug.h"
#undef LOG_PREFIX
#define LOG_PREFIX "timerfd: "
diff --git a/criu/include/bug.h b/include/common/bug.h
similarity index 92%
rename from criu/include/bug.h
rename to include/common/bug.h
index 881f0daf8c2e..462291104086 100644
--- a/criu/include/bug.h
+++ b/include/common/bug.h
@@ -5,7 +5,6 @@
#include <stdbool.h>
#include "common/compiler.h"
-#include "log.h"
#ifndef BUG_ON_HANDLER
@@ -16,6 +15,9 @@
#endif
#ifndef __clang_analyzer__
+# ifndef pr_err
+# error pr_err macro must be defined
+# endif
# define BUG_ON_HANDLER(condition) \
do { \
if ((condition)) { \
--
2.7.4
More information about the CRIU
mailing list