#! /bin/sh
+if ! which lex > /dev/null 2>&1; then
+ echo "WARNING: lex not found!" >&2
+ echo "Make sure that you have a flex compatible tool available." >&2
+fi
+
+if ! which yacc > /dev/null 2>&1; then
+ echo "WARNING: yacc not found!" >&2
+ echo "Make sure that you have a GNU bison compatible tool available." >&2
+fi
+
libtoolize=libtoolize
if which glibtoolize > /dev/null 2>&1; then
fclose (fh_out);
return (-1);
}
- fclose (fh_in); fh_in = NULL; fd = -1;
- fclose (fh_out); fh_out = NULL;
- values_num = atoi (buffer);
- if (values_num < 1)
- return (-1);
+ {
+ char *ptr = strchr (buffer, ' ');
+
+ if (ptr != NULL)
+ *ptr = '\0';
+
+ values_num = atoi (buffer);
+ if (values_num < 1)
+ return (-1);
+ }
values = (double *) malloc (values_num * sizeof (double));
if (values == NULL)
return (-1);
}
+ i = 0;
+ while (fgets (buffer, sizeof (buffer), fh_in) != NULL)
{
- char *ptr = strchr (buffer, ' ') + 1;
char *key;
char *value;
- i = 0;
- while ((key = strtok (ptr, " \t")) != NULL)
- {
- ptr = NULL;
- value = strchr (key, '=');
- if (value == NULL)
- continue;
- *value = '\0'; value++;
+ key = buffer;
- if (ignore_ds (key) != 0)
- continue;
+ value = strchr (key, '=');
+ if (value == NULL)
+ continue;
+ *value = '\0'; value++;
- values_names[i] = strdup (key);
- values[i] = atof (value);
+ if (ignore_ds (key) != 0)
+ continue;
- i++;
- if (i >= values_num)
- break;
- }
- values_num = i;
+ values_names[i] = strdup (key);
+ values[i] = atof (value);
+
+ i++;
+ if (i >= values_num)
+ break;
}
+ values_num = i;
+
+ fclose (fh_in); fh_in = NULL; fd = -1;
+ fclose (fh_out); fh_out = NULL;
*ret_values_num = values_num;
*ret_values = values;
# IgnoreSelected false
#</Plugin>
+#<Plugin df>
+# Disk "/^[hs]d[a-f][0-9]?$/"
+# IgnoreSelected false
+#</Plugin>
+
#<Plugin dns>
# Interface "eth0"
# IgnoreSource "192.168.0.1"
len = strlen (line);
if (('\n' != line[len - 1]) && ('\r' != line[len - 1])) {
- log_warn ("[thread #%5lu] line too long (> %i characters): "
+ log_warn ("[thread #%5lu] line too long (> %lu characters): "
"'%s' (truncated)", self, sizeof (line) - 1, line);
while (NULL != fgets (line, sizeof (line), this->socket))
extern FILE *yyin;
oconfig_item_t *ci_root;
-char *c_file;
+const char *c_file;
static void yyset_in (FILE *fd)
{
if (pkt_item_len < res_item_size)
pkt_padding = res_item_size - pkt_item_len;
DEBUG ("res_item_size = %i; pkt_padding = %i;",
- res_item_size, pkt_padding);
+ res_item_size, (int) pkt_padding);
/* Extract the sequence number */
pkt_sequence = INFO_SEQ (res.auth_seq);
* We start by allocating some more memory.
*/
DEBUG ("realloc (%p, %i)", (void *) *res_data,
- (items_num + pkt_item_num) * res_item_size);
+ (int) (items_num + pkt_item_num) * res_item_size);
items = realloc ((void *) *res_data,
(items_num + pkt_item_num) * res_item_size);
if (items == NULL)
if (ds->ds_num != values_num)
{
ERROR ("ds[%s]->ds_num = %i, "
- "but uc_get_rate_by_name returned %i values.",
- ds->type, ds->ds_num, values_num);
+ "but uc_get_rate_by_name returned %u values.",
+ ds->type, ds->ds_num, (unsigned int) values_num);
print_to_socket (fh, "-1 Error reading value from cache.\n");
sfree (values);
sfree (identifier_copy);
llentry_t *e_this;
llentry_t *e_next;
+ if (l == NULL)
+ return;
+
for (e_this = l->head; e_this != NULL; e_this = e_next)
{
e_next = e_this->next;
{
llentry_t *e;
+ if (l == NULL)
+ return (NULL);
+
for (e = l->head; e != NULL; e = e->next)
if (strcmp (key, e->key) == 0)
break;
llentry_t *llist_head (llist_t *l)
{
+ if (l == NULL)
+ return (NULL);
return (l->head);
}
llentry_t *llist_tail (llist_t *l)
{
+ if (l == NULL)
+ return (NULL);
return (l->tail);
}
"%f. That is within the %s region of %f and %f.",
ds->ds[ds_index].name, values[ds_index],
(state == STATE_ERROR) ? "failure" : "warning",
- min, min);
+ min, max);
}
else
{