projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix build on Solaris 10 i386 part 2
[collectd.git]
/
src
/
utils_match.c
diff --git
a/src/utils_match.c
b/src/utils_match.c
index
0f87bc0
..
bb53a9a
100644
(file)
--- a/
src/utils_match.c
+++ b/
src/utils_match.c
@@
-1,6
+1,6
@@
/**
* collectd - src/utils_match.c
/**
* collectd - src/utils_match.c
- * Copyright (C) 2008 Florian octo Forster
+ * Copyright (C) 2008
-2014
Florian octo Forster
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@
-83,7
+83,7
@@
static int default_callback (const char __attribute__((unused)) *str,
if (matches_num < 2)
return (-1);
if (matches_num < 2)
return (-1);
- value = strtod (matches[1], &endptr);
+ value =
(gauge_t)
strtod (matches[1], &endptr);
if (matches[1] == endptr)
return (-1);
if (matches[1] == endptr)
return (-1);
@@
-131,7
+131,7
@@
static int default_callback (const char __attribute__((unused)) *str,
if (matches_num < 2)
return (-1);
if (matches_num < 2)
return (-1);
- value =
strto
ll (matches[1], &endptr, 0);
+ value =
(counter_t) strtou
ll (matches[1], &endptr, 0);
if (matches[1] == endptr)
return (-1);
if (matches[1] == endptr)
return (-1);
@@
-162,7
+162,7
@@
static int default_callback (const char __attribute__((unused)) *str,
if (matches_num < 2)
return (-1);
if (matches_num < 2)
return (-1);
- value = strtoll (matches[1], &endptr, 0);
+ value =
(derive_t)
strtoll (matches[1], &endptr, 0);
if (matches[1] == endptr)
return (-1);
if (matches[1] == endptr)
return (-1);
@@
-186,7
+186,7
@@
static int default_callback (const char __attribute__((unused)) *str,
if (matches_num < 2)
return (-1);
if (matches_num < 2)
return (-1);
- value =
strto
ll (matches[1], &endptr, 0);
+ value =
(absolute_t) strtou
ll (matches[1], &endptr, 0);
if (matches[1] == endptr)
return (-1);
if (matches[1] == endptr)
return (-1);
@@
-228,7
+228,7
@@
cu_match_t *match_create_callback (const char *regex, const char *excluderegex,
return (NULL);
memset (obj, '\0', sizeof (cu_match_t));
return (NULL);
memset (obj, '\0', sizeof (cu_match_t));
- status = regcomp (&obj->regex, regex, REG_EXTENDED);
+ status = regcomp (&obj->regex, regex, REG_EXTENDED
| REG_NEWLINE
);
if (status != 0)
{
ERROR ("Compiling the regular expression \"%s\" failed.", regex);
if (status != 0)
{
ERROR ("Compiling the regular expression \"%s\" failed.", regex);
@@
-279,6
+279,18
@@
cu_match_t *match_create_simple (const char *regex,
return (obj);
} /* cu_match_t *match_create_simple */
return (obj);
} /* cu_match_t *match_create_simple */
+void match_value_reset (cu_match_value_t *mv)
+{
+ if (mv == NULL)
+ return;
+
+ if (mv->ds_type & UTILS_MATCH_DS_TYPE_GAUGE)
+ {
+ mv->value.gauge = NAN;
+ mv->values_num = 0;
+ }
+} /* }}} void match_value_reset */
+
void match_destroy (cu_match_t *obj)
{
if (obj == NULL)
void match_destroy (cu_match_t *obj)
{
if (obj == NULL)