projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
06c1d15
)
exec plugin: Check return value of plugin_thread_create().
author
Florian Forster
<octo@collectd.org>
Fri, 1 Dec 2017 20:05:00 +0000
(21:05 +0100)
committer
Florian Forster
<octo@collectd.org>
Fri, 1 Dec 2017 20:05:00 +0000
(21:05 +0100)
CID: 37942, 37943
src/exec.c
patch
|
blob
|
history
diff --git
a/src/exec.c
b/src/exec.c
index
246584b
..
60bd961
100644
(file)
--- a/
src/exec.c
+++ b/
src/exec.c
@@
-800,7
+800,11
@@
static int exec_read(void) /* {{{ */
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
- plugin_thread_create(&t, &attr, exec_read_one, (void *)pl, "exec read");
+ int status =
+ plugin_thread_create(&t, &attr, exec_read_one, (void *)pl, "exec read");
+ if (status != 0) {
+ ERROR("exec plugin: plugin_thread_create failed.");
+ }
pthread_attr_destroy(&attr);
} /* for (pl) */
pthread_attr_destroy(&attr);
} /* for (pl) */
@@
-839,8
+843,11
@@
static int exec_notification(const notification_t *n, /* {{{ */
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
- plugin_thread_create(&t, &attr, exec_notification_one, (void *)pln,
- "exec notify");
+ int status = plugin_thread_create(&t, &attr, exec_notification_one,
+ (void *)pln, "exec notify");
+ if (status != 0) {
+ ERROR("exec plugin: plugin_thread_create failed.");
+ }
pthread_attr_destroy(&attr);
} /* for (pl) */
pthread_attr_destroy(&attr);
} /* for (pl) */