projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
.travis.yml: Add coverity addon.
[collectd.git]
/
src
/
write_tsdb.c
diff --git
a/src/write_tsdb.c
b/src/write_tsdb.c
index
10f636c
..
d5d5598
100644
(file)
--- a/
src/write_tsdb.c
+++ b/
src/write_tsdb.c
@@
-111,10
+111,9
@@
static int wt_send_buffer(struct wt_callback *cb) {
ssize_t status = 0;
status = swrite(cb->sock_fd, cb->send_buf, strlen(cb->send_buf));
ssize_t status = 0;
status = swrite(cb->sock_fd, cb->send_buf, strlen(cb->send_buf));
- if (status < 0) {
- char errbuf[1024];
+ if (status != 0) {
ERROR("write_tsdb plugin: send failed with status %zi (%s)", status,
ERROR("write_tsdb plugin: send failed with status %zi (%s)", status,
-
sstrerror(errno, errbuf, sizeof(errbuf))
);
+
STRERRNO
);
close(cb->sock_fd);
cb->sock_fd = -1;
close(cb->sock_fd);
cb->sock_fd = -1;
@@
-242,10
+241,9
@@
static int wt_callback_init(struct wt_callback *cb) {
}
if (cb->sock_fd < 0) {
}
if (cb->sock_fd < 0) {
- char errbuf[1024];
ERROR("write_tsdb plugin: Connecting to %s:%s failed. "
"The last error was: %s",
ERROR("write_tsdb plugin: Connecting to %s:%s failed. "
"The last error was: %s",
- node, service,
sstrerror(errno, errbuf, sizeof(errbuf))
);
+ node, service,
STRERRNO
);
return -1;
}
return -1;
}
@@
-279,6
+277,7
@@
static void wt_callback_free(void *data) {
sfree(cb->service);
sfree(cb->host_tags);
sfree(cb->service);
sfree(cb->host_tags);
+ pthread_mutex_unlock(&cb->send_lock);
pthread_mutex_destroy(&cb->send_lock);
sfree(cb);
pthread_mutex_destroy(&cb->send_lock);
sfree(cb);