diff --git a/criu/action-scripts.c b/criu/action-scripts.c index 99662b46e..e9260f7a1 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 0f06c2d19..6ece3775a 100644 --- a/criu/arch/aarch64/vdso-pie.c +++ b/criu/arch/aarch64/vdso-pie.c @@ -6,7 +6,7 @@ #include "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 db4aadb49..b4bdf23aa 100644 --- a/criu/arch/ppc64/vdso-pie.c +++ b/criu/arch/ppc64/vdso-pie.c @@ -6,7 +6,7 @@ #include "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/vdso-pie.c b/criu/arch/x86/vdso-pie.c index b1e087cd8..cb47496ef 100644 --- a/criu/arch/x86/vdso-pie.c +++ b/criu/arch/x86/vdso-pie.c @@ -6,7 +6,7 @@ #include "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 84f99c5e6..8269ab1a2 100644 --- a/criu/bfd.c +++ b/criu/bfd.c @@ -7,8 +7,9 @@ #include #include -#include "bug.h" +#include "int.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 938d7cece..489801f3f 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 fc1cf893c..1c22a4f66 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 04be917e2..02ad169df 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/lock.h b/criu/include/lock.h index e5b6510f5..6a6eabf25 100644 --- a/criu/include/lock.h +++ b/criu/include/lock.h @@ -7,7 +7,8 @@ #include #include "atomic.h" -#include "bug.h" +#include "log.h" +#include "common/bug.h" #ifdef CR_NOGLIBC # include "syscall.h" diff --git a/criu/include/util.h b/criu/include/util.h index 234c03f4e..68ff10316 100644 --- a/criu/include/util.h +++ b/criu/include/util.h @@ -15,7 +15,7 @@ #include "int.h" #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 39da84b18..70b0c472c 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 36e1eb2da..a6183fcc4 100644 --- a/criu/pie/parasite-vdso.c +++ b/criu/pie/parasite-vdso.c @@ -17,7 +17,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 c24f395ba..0c2275a76 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 "piegen/uapi/types.h" -#include "bug.h" +#include "common/bug.h" __maybe_unused void elf_relocs_apply(void *mem, void *vbase, size_t size, elf_reloc_t *elf_relocs, size_t nr_relocs) { diff --git a/criu/pie/util-fd.c b/criu/pie/util-fd.c index 323ed37b7..57a523eeb 100644 --- a/criu/pie/util-fd.c +++ b/criu/pie/util-fd.c @@ -20,7 +20,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 14a4fb5c2..caea515d5 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 100b7f893..251ca2f17 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 53be2af7b..0b97ced50 100644 --- a/criu/timerfd.c +++ b/criu/timerfd.c @@ -18,7 +18,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 881f0daf8..462291104 100644 --- a/criu/include/bug.h +++ b/include/common/bug.h @@ -5,7 +5,6 @@ #include #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)) { \