[CRIU] [PATCH 7/9] headers: Remove util.h from protobuf.h
Pavel Emelyanov
xemul at virtuozzo.com
Fri Oct 21 05:51:30 PDT 2016
The util.h it pretty big header, those who need utils
should include it explicitly. Right now some of them
only need xmalloc really.
Signed-off-by: Pavel Emelyanov <xemul at virtuozzo.com>
---
criu/autofs.c | 1 +
criu/cr-check.c | 1 +
criu/crtools.c | 1 +
criu/file-lock.c | 1 +
criu/files-reg.c | 1 +
criu/files.c | 1 +
criu/image.c | 2 ++
criu/include/protobuf.h | 4 ++--
criu/namespaces.c | 1 +
criu/net.c | 2 +-
criu/pagemap.c | 1 +
criu/pipes.c | 1 +
criu/protobuf.c | 1 +
criu/pstree.c | 2 +-
criu/shmem.c | 2 +-
criu/sk-inet.c | 1 +
criu/sk-packet.c | 1 +
criu/sockets.c | 1 +
criu/stats.c | 1 +
criu/tty.c | 1 +
criu/tun.c | 2 ++
21 files changed, 24 insertions(+), 5 deletions(-)
diff --git a/criu/autofs.c b/criu/autofs.c
index 0e9883f..345a703 100644
--- a/criu/autofs.c
+++ b/criu/autofs.c
@@ -14,6 +14,7 @@
#include "protobuf.h"
#include "pipes.h"
#include "crtools.h"
+#include "util.h"
#include "images/autofs.pb-c.h"
diff --git a/criu/cr-check.c b/criu/cr-check.c
index 3834a64..352e9c7 100644
--- a/criu/cr-check.c
+++ b/criu/cr-check.c
@@ -39,6 +39,7 @@
#include "ptrace.h"
#include "kerndat.h"
#include "timerfd.h"
+#include "util.h"
#include "tun.h"
#include "namespaces.h"
#include "pstree.h"
diff --git a/criu/crtools.c b/criu/crtools.c
index 6d588f5..3e8d68f 100644
--- a/criu/crtools.c
+++ b/criu/crtools.c
@@ -37,6 +37,7 @@
#include "cr-service.h"
#include "plugin.h"
#include "criu-log.h"
+#include "util.h"
#include "mount.h"
#include "filesystems.h"
#include "namespaces.h"
diff --git a/criu/file-lock.c b/criu/file-lock.c
index 43ffdc5..1ab1e58 100644
--- a/criu/file-lock.c
+++ b/criu/file-lock.c
@@ -12,6 +12,7 @@
#include "fs-magic.h"
#include "kerndat.h"
#include "image.h"
+#include "util.h"
#include "mount.h"
#include "proc_parse.h"
#include "servicefd.h"
diff --git a/criu/files-reg.c b/criu/files-reg.c
index 3e7b63c..03a7bcc 100644
--- a/criu/files-reg.c
+++ b/criu/files-reg.c
@@ -30,6 +30,7 @@
#include "external.h"
#include "protobuf.h"
+#include "util.h"
#include "images/regfile.pb-c.h"
#include "images/remap-file-path.pb-c.h"
diff --git a/criu/files.c b/criu/files.c
index 64f7c16..21af891 100644
--- a/criu/files.c
+++ b/criu/files.c
@@ -45,6 +45,7 @@
#include "parasite-syscall.h"
#include "protobuf.h"
+#include "util.h"
#include "images/fs.pb-c.h"
#include "images/ext-file.pb-c.h"
diff --git a/criu/image.c b/criu/image.c
index 98ce383..edecba6 100644
--- a/criu/image.c
+++ b/criu/image.c
@@ -1,3 +1,4 @@
+#include <stdio.h>
#include <unistd.h>
#include <stdarg.h>
#include <fcntl.h>
@@ -11,6 +12,7 @@
#include "cgroup.h"
#include "lsm.h"
#include "protobuf.h"
+#include "xmalloc.h"
#include "images/inventory.pb-c.h"
#include "images/pagemap.pb-c.h"
diff --git a/criu/include/protobuf.h b/criu/include/protobuf.h
index c2f6850..f94b08d 100644
--- a/criu/include/protobuf.h
+++ b/criu/include/protobuf.h
@@ -1,10 +1,10 @@
#ifndef __CR_PROTOBUF_H__
#define __CR_PROTOBUF_H__
-#include "protobuf-desc.h"
+#include <stdbool.h>
+#include "protobuf-desc.h"
#include "compiler.h"
-#include "util.h"
struct cr_img;
diff --git a/criu/namespaces.c b/criu/namespaces.c
index 69f122b..3b257d0 100644
--- a/criu/namespaces.c
+++ b/criu/namespaces.c
@@ -27,6 +27,7 @@
#include "cgroup.h"
#include "protobuf.h"
+#include "util.h"
#include "images/ns.pb-c.h"
#include "images/userns.pb-c.h"
diff --git a/criu/net.c b/criu/net.c
index b494d97..35388ee 100644
--- a/criu/net.c
+++ b/criu/net.c
@@ -31,7 +31,7 @@
#include "sysctl.h"
#include "kerndat.h"
#include "external.h"
-
+#include "util.h"
#include "protobuf.h"
#include "images/netdev.pb-c.h"
diff --git a/criu/pagemap.c b/criu/pagemap.c
index d0bbfe3..105ad59 100644
--- a/criu/pagemap.c
+++ b/criu/pagemap.c
@@ -9,6 +9,7 @@
#include "servicefd.h"
#include "pagemap.h"
+#include "xmalloc.h"
#include "protobuf.h"
#include "images/pagemap.pb-c.h"
diff --git a/criu/pipes.c b/criu/pipes.c
index d6b0b30..9fc87bd 100644
--- a/criu/pipes.c
+++ b/criu/pipes.c
@@ -13,6 +13,7 @@
#include "autofs.h"
#include "protobuf.h"
+#include "util.h"
#include "images/pipe.pb-c.h"
#include "images/pipe-data.pb-c.h"
#include "fcntl.h"
diff --git a/criu/protobuf.c b/criu/protobuf.c
index 9a90798..b5aa7d3 100644
--- a/criu/protobuf.c
+++ b/criu/protobuf.c
@@ -18,6 +18,7 @@
#include "cr_options.h"
#include "bfd.h"
#include "protobuf.h"
+#include "util.h"
/*
* To speed up reading of packed objects
diff --git a/criu/pstree.c b/criu/pstree.c
index 890809e..ec1f7ee 100644
--- a/criu/pstree.c
+++ b/criu/pstree.c
@@ -13,7 +13,7 @@
#include "tty.h"
#include "mount.h"
#include "dump.h"
-
+#include "util.h"
#include "protobuf.h"
#include "images/pstree.pb-c.h"
diff --git a/criu/shmem.c b/criu/shmem.c
index 79b3a9f..8af612c 100644
--- a/criu/shmem.c
+++ b/criu/shmem.c
@@ -20,7 +20,7 @@
#include "bitops.h"
#include "log.h"
#include "page.h"
-
+#include "util.h"
#include "protobuf.h"
#include "images/pagemap.pb-c.h"
diff --git a/criu/sk-inet.c b/criu/sk-inet.c
index 2e254f4..22ac3a8 100644
--- a/criu/sk-inet.c
+++ b/criu/sk-inet.c
@@ -21,6 +21,7 @@
#include "rst-malloc.h"
#include "sockets.h"
#include "sk-inet.h"
+#include "util.h"
#define PB_ALEN_INET 1
#define PB_ALEN_INET6 4
diff --git a/criu/sk-packet.c b/criu/sk-packet.c
index 8714f40..6e0ad2d 100644
--- a/criu/sk-packet.c
+++ b/criu/sk-packet.c
@@ -15,6 +15,7 @@
#include <arpa/inet.h>
#include "protobuf.h"
+#include "xmalloc.h"
#include "images/packet-sock.pb-c.h"
#include "images/fdinfo.pb-c.h"
diff --git a/criu/sockets.c b/criu/sockets.c
index daa365c..b5c03fd 100644
--- a/criu/sockets.c
+++ b/criu/sockets.c
@@ -22,6 +22,7 @@
#include "sk-packet.h"
#include "namespaces.h"
#include "net.h"
+#include "xmalloc.h"
#include "fs-magic.h"
#ifndef SOCK_DIAG_BY_FAMILY
diff --git a/criu/stats.c b/criu/stats.c
index c6cbc83..7f0e154 100644
--- a/criu/stats.c
+++ b/criu/stats.c
@@ -7,6 +7,7 @@
#include "rst-malloc.h"
#include "protobuf.h"
#include "stats.h"
+#include "util.h"
#include "image.h"
#include "images/stats.pb-c.h"
diff --git a/criu/tty.c b/criu/tty.c
index 557dd77..dbce49c 100644
--- a/criu/tty.c
+++ b/criu/tty.c
@@ -30,6 +30,7 @@
#include "external.h"
#include "protobuf.h"
+#include "util.h"
#include "images/tty.pb-c.h"
#include "parasite-syscall.h"
diff --git a/criu/tun.c b/criu/tun.c
index 6d854e7..391f968 100644
--- a/criu/tun.c
+++ b/criu/tun.c
@@ -1,3 +1,4 @@
+#include <stdio.h>
#include <unistd.h>
#include <sys/socket.h>
#include <linux/if.h>
@@ -17,6 +18,7 @@
#include "tun.h"
#include "net.h"
#include "namespaces.h"
+#include "xmalloc.h"
#include "images/tun.pb-c.h"
--
2.1.4
More information about the CRIU
mailing list