summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>2016-02-06 07:37:21 +0200
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>2016-02-06 07:37:21 +0200
commit56ee3a77006efdc1fb78ea041986b1f7a6ba42b9 (patch)
treef10e2b686c09f14f0da67cc1462f47db9767b8f4 /src
parent1081013ba164de80513395b6180e36452c6c5848 (diff)
added pthread_exit in hope it will solve the crash at exit
Diffstat (limited to 'src')
-rwxr-xr-xsrc/plugin_checks.c1
-rwxr-xr-xsrc/plugin_idlejitter.c1
-rw-r--r--src/plugin_nfacct.c6
-rwxr-xr-xsrc/plugin_proc.c1
-rwxr-xr-xsrc/plugin_tc.c3
-rwxr-xr-xsrc/plugins_d.c4
6 files changed, 16 insertions, 0 deletions
diff --git a/src/plugin_checks.c b/src/plugin_checks.c
index d597e346a1..62cc31da4b 100755
--- a/src/plugin_checks.c
+++ b/src/plugin_checks.c
@@ -91,6 +91,7 @@ void *checks_main(void *ptr)
rrdset_done(check3);
}
+ pthread_exit(NULL);
return NULL;
}
diff --git a/src/plugin_idlejitter.c b/src/plugin_idlejitter.c
index 8f55a002ce..a7197330c1 100755
--- a/src/plugin_idlejitter.c
+++ b/src/plugin_idlejitter.c
@@ -62,6 +62,7 @@ void *cpuidlejitter_main(void *ptr)
rrdset_done(st);
}
+ pthread_exit(NULL);
return NULL;
}
diff --git a/src/plugin_nfacct.c b/src/plugin_nfacct.c
index 8c613c4c28..0c5b39457b 100644
--- a/src/plugin_nfacct.c
+++ b/src/plugin_nfacct.c
@@ -98,12 +98,14 @@ void *nfacct_main(void *ptr) {
nl = mnl_socket_open(NETLINK_NETFILTER);
if(!nl) {
error("nfacct.plugin: mnl_socket_open() failed");
+ pthread_exit(NULL);
return NULL;
}
if(mnl_socket_bind(nl, 0, MNL_SOCKET_AUTOPID) < 0) {
mnl_socket_close(nl);
error("nfacct.plugin: mnl_socket_bind() failed");
+ pthread_exit(NULL);
return NULL;
}
portid = mnl_socket_get_portid(nl);
@@ -127,11 +129,13 @@ void *nfacct_main(void *ptr) {
if(!nlh) {
mnl_socket_close(nl);
error("nfacct.plugin: nfacct_nlmsg_build_hdr() failed");
+ pthread_exit(NULL);
return NULL;
}
if(mnl_socket_sendto(nl, nlh, nlh->nlmsg_len) < 0) {
error("nfacct.plugin: mnl_socket_send");
+ pthread_exit(NULL);
return NULL;
}
@@ -144,6 +148,7 @@ void *nfacct_main(void *ptr) {
if (ret == -1) {
error("nfacct.plugin: error communicating with kernel.");
+ pthread_exit(NULL);
return NULL;
}
@@ -210,6 +215,7 @@ void *nfacct_main(void *ptr) {
}
mnl_socket_close(nl);
+ pthread_exit(NULL);
return NULL;
}
#endif
diff --git a/src/plugin_proc.c b/src/plugin_proc.c
index 7f79364e3b..ac96cb50b2 100755
--- a/src/plugin_proc.c
+++ b/src/plugin_proc.c
@@ -223,5 +223,6 @@ void *proc_main(void *ptr)
bcopy(&now, &last, sizeof(struct timeval));
}
+ pthread_exit(NULL);
return NULL;
}
diff --git a/src/plugin_tc.c b/src/plugin_tc.c
index 15b8077c40..5ed9140505 100755
--- a/src/plugin_tc.c
+++ b/src/plugin_tc.c
@@ -521,6 +521,7 @@ void *tc_main(void *ptr)
fp = mypopen(buffer, &tc_child_pid);
if(!fp) {
error("TC: Cannot popen(\"%s\", \"r\").", buffer);
+ pthread_exit(NULL);
return NULL;
}
@@ -672,12 +673,14 @@ void *tc_main(void *ptr)
if(netdata_exit) {
tc_device_free_all();
+ pthread_exit(NULL);
return NULL;
}
sleep((unsigned int) rrd_update_every);
}
+ pthread_exit(NULL);
return NULL;
}
diff --git a/src/plugins_d.c b/src/plugins_d.c
index c07e592ea2..b4cb57888d 100755
--- a/src/plugins_d.c
+++ b/src/plugins_d.c
@@ -403,6 +403,7 @@ void *pluginsd_worker_thread(void *arg)
cd->pid = 0;
cd->enabled = 0;
cd->obsolete = 1;
+ pthread_exit(NULL);
return NULL;
}
@@ -417,6 +418,7 @@ void *pluginsd_worker_thread(void *arg)
}
cd->obsolete = 1;
+ pthread_exit(NULL);
return NULL;
}
@@ -450,6 +452,7 @@ void *pluginsd_main(void *ptr)
dir = opendir(dir_name);
if(unlikely(!dir)) {
error("Cannot open directory '%s'.", dir_name);
+ pthread_exit(NULL);
return NULL;
}
@@ -524,6 +527,7 @@ void *pluginsd_main(void *ptr)
sleep((unsigned int) scan_frequency);
}
+ pthread_exit(NULL);
return NULL;
}