[CRIU] [PATCH] socket: remove unused code

Andrey Vagin avagin at openvz.org
Fri Jul 31 12:23:38 PDT 2015


Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 include/sockets.h |  5 -----
 sockets.c         | 51 ---------------------------------------------------
 2 files changed, 56 deletions(-)

diff --git a/include/sockets.h b/include/sockets.h
index a3010e1..2c35adc 100644
--- a/include/sockets.h
+++ b/include/sockets.h
@@ -43,11 +43,6 @@ extern int resolve_unix_peers(void);
 
 extern struct collect_image_info netlink_sk_cinfo;
 
-extern char *skfamily2s(u32 f);
-extern char *sktype2s(u32 t);
-extern char *skproto2s(u32 p);
-extern char *skstate2s(u32 state);
-
 extern struct socket_desc *lookup_socket(int ino, int family, int proto);
 
 extern const struct fdtype_ops unix_dump_ops;
diff --git a/sockets.c b/sockets.c
index 134d9b5..5aa2e7b 100644
--- a/sockets.c
+++ b/sockets.c
@@ -727,54 +727,3 @@ int collect_sockets(struct ns_id *ns)
 
 	return err;
 }
-
-static inline char *unknown(u32 val)
-{
-	static char unk[12];
-	snprintf(unk, sizeof(unk), "x%d", val);
-	return unk;
-}
-
-char *skfamily2s(u32 f)
-{
-	if (f == AF_INET)
-		return " inet";
-	else if (f == AF_INET6)
-		return "inet6";
-	else
-		return unknown(f);
-}
-
-char *sktype2s(u32 t)
-{
-	if (t == SOCK_STREAM)
-		return "stream";
-	else if (t == SOCK_DGRAM)
-		return " dgram";
-	else
-		return unknown(t);
-}
-
-char *skproto2s(u32 p)
-{
-	if (p == IPPROTO_UDP)
-		return "udp";
-	else if (p == IPPROTO_UDPLITE)
-		return "udpl";
-	else if (p == IPPROTO_TCP)
-		return "tcp";
-	else
-		return unknown(p);
-}
-
-char *skstate2s(u32 state)
-{
-	if (state == TCP_ESTABLISHED)
-		return " estab";
-	else if (state == TCP_CLOSE)
-		return "closed";
-	else if (state == TCP_LISTEN)
-		return "listen";
-	else
-		return unknown(state);
-}
-- 
2.1.0



More information about the CRIU mailing list