diff options
author | Vladimir Kobal <vlad@prokk.net> | 2019-02-07 17:04:58 +0200 |
---|---|---|
committer | Paweł Krupa <pawel@krupa.net.pl> | 2019-02-07 16:04:58 +0100 |
commit | 621caf7e21abeed82bc77a70a7e3d9d564cffd53 (patch) | |
tree | 5ee16ed12005ea6a0d8039ae62e2a11b8bbf6554 | |
parent | 8e818c288883b564cb6678de1b84849494b6a463 (diff) |
Fix cgroups Codacy issue (#5340)
* Fix cgroups Codacy issue
* Fix codacy issue
-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) { |