diff options
-rw-r--r-- | collectors/cgroups.plugin/cgroup-network.c | 6 |
1 files changed, 3 insertions, 3 deletions
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) { |