projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
exec plugin: Fixed a "control reaches end of non-void function" warning.
[collectd.git]
/
src
/
utils_ignorelist.c
diff --git
a/src/utils_ignorelist.c
b/src/utils_ignorelist.c
index
532eb4b
..
d2546aa
100644
(file)
--- a/
src/utils_ignorelist.c
+++ b/
src/utils_ignorelist.c
@@
-47,8
+47,12
@@
* return;
**/
* return;
**/
+#if HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#include "common.h"
#include "common.h"
-#include "
utils_debug
.h"
+#include "
plugin
.h"
#include "utils_ignorelist.h"
/*
#include "utils_ignorelist.h"
/*
@@
-94,7
+98,7
@@
static int ignorelist_append_regex(ignorelist_t *il, const char *entry)
/* create buffer */
if ((regtemp = malloc(sizeof(regex_t))) == NULL)
{
/* create buffer */
if ((regtemp = malloc(sizeof(regex_t))) == NULL)
{
-
syslog (LOG_ERR,
"cannot allocate new config entry");
+
ERROR (
"cannot allocate new config entry");
return (1);
}
memset (regtemp, '\0', sizeof(regex_t));
return (1);
}
memset (regtemp, '\0', sizeof(regex_t));
@@
-111,14
+115,14
@@
static int ignorelist_append_regex(ignorelist_t *il, const char *entry)
{
fprintf (stderr, "Cannot compile regex %s: %i/%s",
entry, rcompile, regerr);
{
fprintf (stderr, "Cannot compile regex %s: %i/%s",
entry, rcompile, regerr);
-
syslog (LOG_ERR,
"Cannot compile regex %s: %i/%s",
+
ERROR (
"Cannot compile regex %s: %i/%s",
entry, rcompile, regerr);
}
else
{
fprintf (stderr, "Cannot compile regex %s: %i",
entry, rcompile);
entry, rcompile, regerr);
}
else
{
fprintf (stderr, "Cannot compile regex %s: %i",
entry, rcompile);
-
syslog (LOG_ERR,
"Cannot compile regex %s: %i",
+
ERROR (
"Cannot compile regex %s: %i",
entry, rcompile);
}
entry, rcompile);
}
@@
-127,12
+131,12
@@
static int ignorelist_append_regex(ignorelist_t *il, const char *entry)
regfree (regtemp);
return (1);
}
regfree (regtemp);
return (1);
}
- D
B
G("regex compiled: %s - %i", entry, rcompile);
+ D
EBU
G("regex compiled: %s - %i", entry, rcompile);
/* create new entry */
if ((new = malloc(sizeof(ignorelist_item_t))) == NULL)
{
/* create new entry */
if ((new = malloc(sizeof(ignorelist_item_t))) == NULL)
{
-
syslog (LOG_ERR,
"cannot allocate new config entry");
+
ERROR (
"cannot allocate new config entry");
regfree (regtemp);
return (1);
}
regfree (regtemp);
return (1);
}
@@
-153,7
+157,7
@@
static int ignorelist_append_string(ignorelist_t *il, const char *entry)
/* create new entry */
if ((new = malloc(sizeof(ignorelist_item_t))) == NULL )
{
/* create new entry */
if ((new = malloc(sizeof(ignorelist_item_t))) == NULL )
{
-
syslog (LOG_ERR,
"cannot allocate new entry");
+
ERROR (
"cannot allocate new entry");
return (1);
}
memset (new, '\0', sizeof(ignorelist_item_t));
return (1);
}
memset (new, '\0', sizeof(ignorelist_item_t));
@@
-213,7
+217,7
@@
ignorelist_t *ignorelist_create (int invert)
/* smalloc exits if it failes */
il = (ignorelist_t *) smalloc (sizeof (ignorelist_t));
/* smalloc exits if it failes */
il = (ignorelist_t *) smalloc (sizeof (ignorelist_t));
- D
B
G("Ignorelist created 0x%p, default is %s",
+ D
EBU
G("Ignorelist created 0x%p, default is %s",
(void *) il,
invert ? "collect" : "ignore");
(void *) il,
invert ? "collect" : "ignore");
@@
-236,7
+240,7
@@
void ignorelist_free (ignorelist_t *il)
ignorelist_item_t *this;
ignorelist_item_t *next;
ignorelist_item_t *this;
ignorelist_item_t *next;
- D
B
G ("(il = 0x%p)", (void *) il);
+ D
EBU
G ("(il = 0x%p)", (void *) il);
if (il == NULL)
return;
if (il == NULL)
return;
@@
-270,7
+274,7
@@
void ignorelist_set_invert (ignorelist_t *il, int invert)
{
if (il == NULL)
{
{
if (il == NULL)
{
- D
B
G("ignore call with ignorelist_t == NULL");
+ D
EBU
G("ignore call with ignorelist_t == NULL");
return;
}
return;
}
@@
-288,7
+292,7
@@
int ignorelist_add (ignorelist_t *il, const char *entry)
if (il == NULL)
{
if (il == NULL)
{
- D
B
G ("add called with ignorelist_t == NULL");
+ D
EBU
G ("add called with ignorelist_t == NULL");
return (1);
}
return (1);
}
@@
-297,7
+301,7
@@
int ignorelist_add (ignorelist_t *il, const char *entry)
/* append nothing */
if (entry_len == 0)
{
/* append nothing */
if (entry_len == 0)
{
- D
B
G("not appending: empty entry");
+ D
EBU
G("not appending: empty entry");
return (1);
}
return (1);
}
@@
-312,14
+316,14
@@
int ignorelist_add (ignorelist_t *il, const char *entry)
memset (entry_copy, '\0', entry_len);
strncpy (entry_copy, entry + 1, entry_len - 2);
memset (entry_copy, '\0', entry_len);
strncpy (entry_copy, entry + 1, entry_len - 2);
- D
B
G("I'm about to add regex entry: %s", entry_copy);
+ D
EBU
G("I'm about to add regex entry: %s", entry_copy);
ret = ignorelist_append_regex(il, entry_copy);
sfree (entry_copy);
}
else
#endif
{
ret = ignorelist_append_regex(il, entry_copy);
sfree (entry_copy);
}
else
#endif
{
- D
B
G("to add entry: %s", entry);
+ D
EBU
G("to add entry: %s", entry);
ret = ignorelist_append_string(il, entry);
}
ret = ignorelist_append_string(il, entry);
}