projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
write_sensu: use sstrncpy
[collectd.git]
/
src
/
log_logstash.c
diff --git
a/src/log_logstash.c
b/src/log_logstash.c
index
0605930
..
de34b0e
100644
(file)
--- a/
src/log_logstash.c
+++ b/
src/log_logstash.c
@@
-160,9
+160,8
@@
static void log_logstash_print(yajl_gen g, int severity,
}
if (fh == NULL) {
}
if (fh == NULL) {
- char errbuf[1024];
fprintf(stderr, "log_logstash plugin: fopen (%s) failed: %s\n", log_file,
fprintf(stderr, "log_logstash plugin: fopen (%s) failed: %s\n", log_file,
-
sstrerror(errno, errbuf, sizeof(errbuf))
);
+
STRERRNO
);
} else {
fprintf(fh, "%s\n", buf);
if (do_close) {
} else {
fprintf(fh, "%s\n", buf);
if (do_close) {
@@
-236,7
+235,7
@@
static int log_logstash_notification(const notification_t *n,
if (g == NULL) {
fprintf(stderr, "Could not allocate JSON generator.\n");
if (g == NULL) {
fprintf(stderr, "Could not allocate JSON generator.\n");
- return
(0)
;
+ return
0
;
}
if (yajl_gen_map_open(g) != yajl_gen_status_ok)
}
if (yajl_gen_map_open(g) != yajl_gen_status_ok)
@@
-323,12
+322,12
@@
static int log_logstash_notification(const notification_t *n,
}
log_logstash_print(g, LOG_INFO, (n->time != 0) ? n->time : cdtime());
}
log_logstash_print(g, LOG_INFO, (n->time != 0) ? n->time : cdtime());
- return
(0)
;
+ return
0
;
err:
yajl_gen_free(g);
fprintf(stderr, "Could not correctly generate JSON notification\n");
err:
yajl_gen_free(g);
fprintf(stderr, "Could not correctly generate JSON notification\n");
- return
(0)
;
+ return
0
;
} /* int log_logstash_notification */
void module_register(void) {
} /* int log_logstash_notification */
void module_register(void) {