From 621caf7e21abeed82bc77a70a7e3d9d564cffd53 Mon Sep 17 00:00:00 2001 From: Vladimir Kobal Date: Thu, 7 Feb 2019 17:04:58 +0200 Subject: Fix cgroups Codacy issue (#5340) * Fix cgroups Codacy issue * Fix codacy issue --- collectors/cgroups.plugin/cgroup-network.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'collectors/cgroups.plugin') diff --git a/collectors/cgroups.plugin/cgroup-network.c b/collectors/cgroups.plugin/cgroup-network.c index 5aeb9a59a8..385672295e 100644 --- a/collectors/cgroups.plugin/cgroup-network.c +++ b/collectors/cgroups.plugin/cgroup-network.c @@ -240,7 +240,7 @@ int switch_namespace(const char *prefix, pid_t pid) { // This code cannot switch user namespace (it can all the other namespaces) // Fortunately, we don't need to switch user namespaces. - int pass, errors = 0; + int pass; for(pass = 0; pass < 2 ;pass++) { for(i = 0; all_ns[i].name ; i++) { if (all_ns[i].fd != -1 && all_ns[i].status == -1) { @@ -248,7 +248,6 @@ int switch_namespace(const char *prefix, pid_t pid) { if(pass == 1) { all_ns[i].status = 0; error("Cannot switch to %s namespace of pid %d", all_ns[i].name, (int) pid); - errors++; } } else @@ -423,7 +422,8 @@ int send_devices(void) { // since it switches namespaces, so after this call, everything is different! void detect_veth_interfaces(pid_t pid) { - struct iface *host = NULL, *cgroup = NULL, *h, *c; + struct iface *cgroup = NULL; + struct iface *host, *h, *c; host = read_proc_net_dev(netdata_configured_host_prefix); if(!host) { -- cgit v1.2.3