summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7274cb0)
raw | patch | inline | side by side (parent: 7274cb0)
author | Peter Green <plugwash@p10link.net> | |
Tue, 16 Aug 2011 06:48:52 +0000 (08:48 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Tue, 16 Aug 2011 06:48:52 +0000 (08:48 +0200) |
Signed-off-by: Florian Forster <octo@collectd.org>
src/disk.c | patch | blob | history | |
src/java.c | patch | blob | history | |
src/libvirt.c | patch | blob | history | |
src/match_empty_counter.c | patch | blob | history | |
src/mysql.c | patch | blob | history | |
src/network.c | patch | blob | history | |
src/notify_email.c | patch | blob | history | |
src/owniptc/libiptc.c | patch | blob | history | |
src/processes.c | patch | blob | history | |
src/teamspeak2.c | patch | blob | history | |
src/utils_dns.c | patch | blob | history |
diff --git a/src/disk.c b/src/disk.c
index 0a90899215b8f6b827ccb147a9b648f2861474f9..6187459f8e93fd0088d6b5646f19b204e1e1827e 100644 (file)
--- a/src/disk.c
+++ b/src/disk.c
int numfields;
int fieldshift = 0;
- int major = 0;
int minor = 0;
counter_t read_sectors = 0;
if ((numfields != (14 + fieldshift)) && (numfields != 7))
continue;
- major = atoll (fields[0]);
minor = atoll (fields[1]);
disk_name = fields[2 + fieldshift];
diff --git a/src/java.c b/src/java.c
index b2ff4981fcfe77a9ac9d38cf3d25eccd869c9482..a8ffd8e3ddc158c83b0b9792ff859681b55e5445 100644 (file)
--- a/src/java.c
+++ b/src/java.c
cjni_callback_info_t *cbi;
jobject o_ocitem;
const char *name;
- int status;
size_t i;
jclass class;
method = (*jvm_env)->GetMethodID (jvm_env, class,
"config", "(Lorg/collectd/api/OConfigItem;)I");
- status = (*jvm_env)->CallIntMethod (jvm_env,
+ (*jvm_env)->CallIntMethod (jvm_env,
cbi->object, method, o_ocitem);
(*jvm_env)->DeleteLocalRef (jvm_env, o_ocitem);
if (config_block != NULL)
{
- int status;
- status = cjni_config_perform (config_block);
+ cjni_config_perform (config_block);
oconfig_free (config_block);
config_block = NULL;
}
diff --git a/src/libvirt.c b/src/libvirt.c
index 91fda7a5e6c9bcba145da37211356a6acdeef4de..1f6287923fae47fbcd48bee83c660f66352da35c 100644 (file)
--- a/src/libvirt.c
+++ b/src/libvirt.c
int i, n;
const char *name;
char uuid[VIR_UUID_STRING_BUFLEN];
- char *host_ptr;
- size_t host_len;
vl->time = t;
vl->interval = interval_g;
sstrncpy (vl->plugin, "libvirt", sizeof (vl->plugin));
vl->host[0] = '\0';
- host_ptr = vl->host;
- host_len = sizeof (vl->host);
/* Construct the hostname field according to HostnameFormat. */
for (i = 0; i < HF_MAX_FIELDS; ++i) {
index b9afd81764b1a0ba2227000966f984f33b7825fd..1ab445a7af0d793a825da5e72fd1465dbc59ebad 100644 (file)
const value_list_t *vl,
notification_meta_t __attribute__((unused)) **meta, void **user_data)
{
- mec_match_t *m;
int num_counters;
int num_empty;
int i;
if ((user_data == NULL) || (*user_data == NULL))
return (-1);
- m = *user_data;
num_counters = 0;
num_empty = 0;
diff --git a/src/mysql.c b/src/mysql.c
index c7b796b18d79d5c92dcc34cacba287c4a0db26ea..bfdbb76667aebc80d4a11f8a0714294b09cbdc94 100644 (file)
--- a/src/mysql.c
+++ b/src/mysql.c
MYSQL_RES *res;
MYSQL_ROW row;
char *query;
- int field_num;
unsigned long long qcache_hits = 0ULL;
unsigned long long qcache_inserts = 0ULL;
if (res == NULL)
return (-1);
- field_num = mysql_num_fields (res);
+ mysql_num_fields (res);
while ((row = mysql_fetch_row (res)))
{
char *key;
diff --git a/src/network.c b/src/network.c
index 412b457bcf522028b8e8a9a82ed37697e86fbe58..95f54641ae6e96af855494190272472b67458cd2 100644 (file)
--- a/src/network.c
+++ b/src/network.c
size_t exp_size = 2 * sizeof (uint16_t) + sizeof (uint64_t);
uint16_t pkg_length;
- uint16_t pkg_type;
if ((buffer_len < 0) || ((size_t) buffer_len < exp_size))
{
memcpy ((void *) &tmp16, buffer, sizeof (tmp16));
buffer += sizeof (tmp16);
- pkg_type = ntohs (tmp16);
+ /* pkg_type = ntohs (tmp16); */
memcpy ((void *) &tmp16, buffer, sizeof (tmp16));
buffer += sizeof (tmp16);
size_t header_size = 2 * sizeof (uint16_t);
uint16_t pkg_length;
- uint16_t pkg_type;
if ((buffer_len < 0) || (buffer_len < header_size))
{
memcpy ((void *) &tmp16, buffer, sizeof (tmp16));
buffer += sizeof (tmp16);
- pkg_type = ntohs (tmp16);
+ /* pkg_type = ntohs (tmp16); */
memcpy ((void *) &tmp16, buffer, sizeof (tmp16));
buffer += sizeof (tmp16);
diff --git a/src/notify_email.c b/src/notify_email.c
index 0aed27f12bb2ac8b41b5fa4e80d586e0c71f8bca..08f865fc2c57805866ce3475a3ec9b3a77ed0e9a 100644 (file)
--- a/src/notify_email.c
+++ b/src/notify_email.c
static int notify_email_notification (const notification_t *n,
user_data_t __attribute__((unused)) *user_data)
{
- smtp_recipient_t recipient;
struct tm timestamp_tm;
char timestamp_str[64];
smtp_set_message_str (message, buf);
for (i = 0; i < recipients_len; i++)
- recipient = smtp_add_recipient (message, recipients[i]);
+ smtp_add_recipient (message, recipients[i]);
/* Initiate a connection to the SMTP server and transfer the message. */
if (!smtp_start_session (session)) {
pthread_mutex_unlock (&session_lock);
return (-1);
} else {
- const smtp_status_t *status;
- /* Report on the success or otherwise of the mail transfer. */
- status = smtp_message_transfer_status (message);
- DEBUG ("notify_email plugin: SMTP server report: %d %s",
+ #if COLLECT_DEBUG
+ const smtp_status_t *status;
+ /* Report on the success or otherwise of the mail transfer. */
+ status = smtp_message_transfer_status (message);
+ DEBUG ("notify_email plugin: SMTP server report: %d %s",
status->code, (status->text != NULL) ? status->text : "\n");
+ #else
+ //I don't know if the function below has side affects so i'm calling it to be on the safe side.
+ smtp_message_transfer_status (message);
+ #endif
smtp_enumerate_recipients (message, print_recipient_status, NULL);
}
diff --git a/src/owniptc/libiptc.c b/src/owniptc/libiptc.c
index 8f0b0f0972e1cdfaa4d0346c9141d3f65e98ffab..7e48e18243c455ed33582590bb870a1a516a22bf 100644 (file)
--- a/src/owniptc/libiptc.c
+++ b/src/owniptc/libiptc.c
*/
static int iptcc_chain_index_delete_chain(struct chain_head *c, TC_HANDLE_T h)
{
- struct list_head *index_ptr, *index_ptr2, *next;
+ struct list_head *index_ptr, *next;
struct chain_head *c2;
unsigned int idx, idx2;
* is located in the same index bucket.
*/
c2 = list_entry(next, struct chain_head, list);
- index_ptr2 = iptcc_bsearch_chain_index(c2->name, &idx2, h);
+ iptcc_bsearch_chain_index(c2->name, &idx2, h);
if (idx != idx2) {
/* Rebuild needed */
return iptcc_chain_index_rebuild(h);
static TC_HANDLE_T
alloc_handle(const char *tablename, unsigned int size, unsigned int num_rules)
{
- size_t len;
TC_HANDLE_T h;
- len = sizeof(STRUCT_TC_HANDLE) + size;
h = malloc(sizeof(STRUCT_TC_HANDLE));
if (!h) {
diff --git a/src/processes.c b/src/processes.c
index 7a5a9c07c4ac5ea0aedc55cbd9c172df74a47b3c..bab7080faa753eb8c80605bef8712dfe41b560a4 100644 (file)
--- a/src/processes.c
+++ b/src/processes.c
int i;
- int ppid;
int name_len;
long long unsigned cpu_user_counter;
fields[1][name_len] = '\0';
strncpy (ps->name, fields[1], PROCSTAT_NAME_LEN);
- ppid = atoi (fields[3]);
*state = fields[2][0];
diff --git a/src/teamspeak2.c b/src/teamspeak2.c
index d4bf2aa40dcb1d3172fce8f6d4878f19461e296c..502145d36dc89bd459be4f32636da13747510665 100644 (file)
--- a/src/teamspeak2.c
+++ b/src/teamspeak2.c
char *buffer_ptr;
buffer_ptr = fgets (buffer, sizeof (buffer), global_read_fh);
+ if (buffer_ptr == NULL)
+ {
+ WARNING ("teamspeak2 plugin: Unexpected EOF received "
+ "from remote host %s:%s.",
+ config_host ? config_host : DEFAULT_HOST,
+ config_port ? config_port : DEFAULT_PORT);
+ }
buffer[sizeof (buffer) - 1] = 0;
if (memcmp ("[TS]\r\n", buffer, 6) != 0)
diff --git a/src/utils_dns.c b/src/utils_dns.c
index 2348be24db05d55c5b1d6b6ad000ce8108594701..9a2e479c5ce500a60d396c30140768d9091ab769 100644 (file)
--- a/src/utils_dns.c
+++ b/src/utils_dns.c
int nexthdr;
struct in6_addr s_addr;
- struct in6_addr d_addr;
uint16_t payload_len;
if (0 > len)
offset = sizeof (struct ip6_hdr);
nexthdr = ipv6->ip6_nxt;
s_addr = ipv6->ip6_src;
- d_addr = ipv6->ip6_dst;
payload_len = ntohs (ipv6->ip6_plen);
if (ignore_list_match (&s_addr))