[CRIU] [PATCH 2/2] soccr: clean a bit includes list

Dmitry Safonov dsafonov at virtuozzo.com
Fri Apr 28 11:28:38 PDT 2017


soccr.h:
After previous patch <linux/types.h> is not needed anymore,
<netinet/tcp.h> is needed as we test for it in feature tests,
i.e., struct tcp_repair_window is declared there.
Also drop forward-declaration of (struct libsoccr_sk) - it's
declared again below.

soccr.c:
Sort headers by name so errors like twice-including errno.h
will not happen again. Also remove assert.h.

Signed-off-by: Dmitry Safonov <dsafonov at virtuozzo.com>
---
 soccr/soccr.c | 10 ++++------
 soccr/soccr.h |  9 ++++-----
 2 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/soccr/soccr.c b/soccr/soccr.c
index 0a774814967c..583f1eaaa1d2 100644
--- a/soccr/soccr.c
+++ b/soccr/soccr.c
@@ -1,13 +1,11 @@
+#include <errno.h>
+#include <libnet.h>
+#include <linux/sockios.h>
+#include <linux/types.h>
 #include <netinet/tcp.h>
 #include <stdlib.h>
 #include <string.h>
 #include <sys/ioctl.h>
-#include <errno.h>
-#include <linux/sockios.h>
-#include <libnet.h>
-#include <assert.h>
-#include <errno.h>
-
 #include "soccr.h"
 
 #ifndef SIOCOUTQNSD
diff --git a/soccr/soccr.h b/soccr/soccr.h
index 2957fd6c4abd..c9d138bfc194 100644
--- a/soccr/soccr.h
+++ b/soccr/soccr.h
@@ -1,8 +1,9 @@
 #ifndef __LIBSOCCR_H__
 #define __LIBSOCCR_H__
-#include <linux/types.h>
-#include <netinet/in.h>
-#include <stdint.h>
+#include <netinet/in.h>		/* sockaddr_in, sockaddr_in6 */
+#include <netinet/tcp.h>	/* TCP_REPAIR_WINDOW, TCP_TIMESTAMP */
+#include <stdint.h>		/* uint32_t */
+#include <sys/socket.h>		/* sockaddr */
 
 #include "config.h"
 
@@ -49,8 +50,6 @@ enum {
 #define TCP_REPAIR_WINDOW       29
 #endif
 
-struct libsoccr_sk;
-
 void libsoccr_set_log(unsigned int level, void (*fn)(unsigned int level, const char *fmt, ...));
 
 #define SOCCR_LOG_ERR	1
-- 
2.12.2



More information about the CRIU mailing list