summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fc257d8)
raw | patch | inline | side by side (parent: fc257d8)
author | Sebastian Harl <sh@tokkee.org> | |
Thu, 30 Nov 2006 11:01:32 +0000 (12:01 +0100) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sat, 2 Dec 2006 17:02:43 +0000 (18:02 +0100) |
Removed debugging output and whitespaces at end of lines.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Sebastian Harl <sh@tokkee.org>
src/email.c | patch | blob | history |
diff --git a/src/email.c b/src/email.c
index b1eaf404eac7ebf22c51012ebd0e56a0be590fb2..5f612cd7eab121c92eb5a1b4cb883959788e1f5b 100644 (file)
--- a/src/email.c
+++ b/src/email.c
/*
* This plugin communicates with a spam filter, a virus scanner or similar
* software using a UNIX socket and a very simple protocol:
- *
+ *
* e-mail type (e.g. ham, spam, virus, ...) and size
* e:<type>:<bytes>
*
static type_list_t count;
#define SIZE_FILE "email/email_size-%s.rrd"
-static char *size_ds_def[] =
+static char *size_ds_def[] =
{
"DS:size:GAUGE:"COLLECTD_HEARTBEAT":0:U",
NULL
do {
errno = 0;
- if (0 > (len = read (src->socket,
- (void *)(&(src->buffer[0]) + src->idx),
+ if (0 > (len = read (src->socket,
+ (void *)(&(src->buffer[0]) + src->idx),
BUFSIZE - src->idx))) {
if (EINTR != errno) {
syslog (LOG_ERR, "read() failed: %s", strerror (errno));
}
else if ('s' == line[0]) { /* s:<value> */
pthread_mutex_lock (&score_mutex);
- score = (score * (double)score_count + atof (line + 2))
+ score = (score * (double)score_count + atof (line + 2))
/ (double)(score_count + 1);
++score_count;
pthread_mutex_unlock (&score_mutex);
errno = 0;
if (-1 == bind (local, (struct sockaddr *)&addr,
- offsetof (struct sockaddr_un, sun_path)
+ offsetof (struct sockaddr_un, sun_path)
+ strlen(addr.sun_path))) {
disabled = 1;
syslog (LOG_ERR, "bind() failed: %s", strerror (errno));
pthread_attr_init (&ptattr);
pthread_attr_setdetachstate (&ptattr, PTHREAD_CREATE_DETACHED);
- if (0 == (err = pthread_create (&collector->thread, &ptattr, collect,
+ if (0 == (err = pthread_create (&collector->thread, &ptattr, collect,
(void *)collector))) {
pthread_mutex_lock (&active_mutex);
{
int err = 0;
- if (0 != (err = pthread_create (&connector, NULL,
+ if (0 != (err = pthread_create (&connector, NULL,
open_connection, NULL))) {
disabled = 1;
syslog (LOG_ERR, "pthread_create() failed: %s", strerror (err));
return;
plugin_submit (plugin, inst, buf);
-fprintf(stderr, "plugin_submit (\"%s\", \"%s\", \"%s\")\n", plugin, inst, buf);
return;
} /* static void type_submit (char *, char *, int) */
return;
plugin_submit ("email_spam_score", NULL, buf);
-fprintf(stderr, "plugin_submit (\"%s\", \"%s\", \"%s\")\n", "email_spam_score", "\0", buf);
return;
}