[CRIU] [PATCH] Move headers around to fix issues on custom-built glibc

Dmitry Safonov dsafonov at virtuozzo.com
Tue Aug 16 08:52:56 PDT 2016


Hi,

On 08/16/2016 06:13 PM, Nikolay Borisov wrote:
> diff --git a/criu/arch/x86/crtools.c b/criu/arch/x86/crtools.c
> index 51eab133f269..54ccf8465f7f 100644
> --- a/criu/arch/x86/crtools.c
> +++ b/criu/arch/x86/crtools.c
> @@ -11,9 +11,9 @@
>
>  #include "cr_options.h"
>  #include "compiler.h"
> +#include "restorer.h"
>  #include "ptrace.h"
>  #include "parasite-syscall.h"
> -#include "restorer.h"
>  #include "log.h"
>  #include "util.h"
>  #include "cpu.h"
>

Hmm, from my POV, one should avoid hard include seq-dependencies as
much as possible.
As F_{S,G}ETPIPE_SZ are defined both in fcntl.h and config-base.h,
can we do something like that? Am I missing something?

--->8--->8--->8---8<---8<---8<---

diff --git a/criu/include/config-base.h b/criu/include/config-base.h
index 5e26859658e1..f877c05d1788 100644
--- a/criu/include/config-base.h
+++ b/criu/include/config-base.h
@@ -29,12 +29,4 @@ struct kernel_pipe_buffer {
  # define F_LINUX_SPECIFIC_BASE 1024
  #endif

-#ifndef F_SETPIPE_SZ
-# define F_SETPIPE_SZ	(F_LINUX_SPECIFIC_BASE + 7)
-#endif
-
-#ifndef F_GETPIPE_SZ
-# define F_GETPIPE_SZ  (F_LINUX_SPECIFIC_BASE + 8)
-#endif
-
  #endif /* __CR_CONFIG_BASE_H__ */
diff --git a/criu/page-pipe.c b/criu/page-pipe.c
index df028dcb33d3..d68804420dc0 100644
--- a/criu/page-pipe.c
+++ b/criu/page-pipe.c
@@ -1,9 +1,9 @@
  #include <unistd.h>
-#include <fcntl.h>

  #undef LOG_PREFIX
  #define LOG_PREFIX "page-pipe: "

+#include "fcntl.h"
  #include "config.h"
  #include "util.h"
  #include "page-pipe.h"
diff --git a/criu/page-xfer.c b/criu/page-xfer.c
index cd07dee446c3..0f42a279e3fa 100644
--- a/criu/page-xfer.c
+++ b/criu/page-xfer.c
@@ -3,11 +3,11 @@
  #include <arpa/inet.h>
  #include <linux/falloc.h>
  #include <unistd.h>
-#include <fcntl.h>
  #include <sys/types.h>
  #include <sys/wait.h>
  #include <sys/stat.h>

+#include "fcntl.h"
  #include "cr_options.h"
  #include "servicefd.h"
  #include "image.h"
diff --git a/criu/pipes.c b/criu/pipes.c
index 57618479307f..68c8fe1297eb 100644
--- a/criu/pipes.c
+++ b/criu/pipes.c
@@ -1,7 +1,6 @@
  #include <unistd.h>
  #include <sys/types.h>
  #include <sys/stat.h>
-#include <fcntl.h>
  #include <stdlib.h>
  #include <sys/mman.h>



More information about the CRIU mailing list