projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #1454 from rubenk/libi2c-dev-mark-as-linux-only
[collectd.git]
/
src
/
csv.c
diff --git
a/src/csv.c
b/src/csv.c
index
958e34b
..
7b513e7
100644
(file)
--- a/
src/csv.c
+++ b/
src/csv.c
@@
-17,7
+17,7
@@
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* Authors:
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* Authors:
- * Florian octo Forster <octo at
verplant
.org>
+ * Florian octo Forster <octo at
collectd
.org>
* Doug MacEachern <dougm@hyperic.com>
**/
* Doug MacEachern <dougm@hyperic.com>
**/
@@
-25,7
+25,6
@@
#include "plugin.h"
#include "common.h"
#include "utils_cache.h"
#include "plugin.h"
#include "common.h"
#include "utils_cache.h"
-#include "utils_parse_option.h"
/*
* Private variables
/*
* Private variables
@@
-46,7
+45,7
@@
static int value_list_to_string (char *buffer, int buffer_len,
{
int offset;
int status;
{
int offset;
int status;
-
in
t i;
+
size_
t i;
gauge_t *rates = NULL;
assert (0 == strcmp (ds->type, vl->type));
gauge_t *rates = NULL;
assert (0 == strcmp (ds->type, vl->type));
@@
-65,13
+64,16
@@
static int value_list_to_string (char *buffer, int buffer_len,
&& (ds->ds[i].type != DS_TYPE_GAUGE)
&& (ds->ds[i].type != DS_TYPE_DERIVE)
&& (ds->ds[i].type != DS_TYPE_ABSOLUTE))
&& (ds->ds[i].type != DS_TYPE_GAUGE)
&& (ds->ds[i].type != DS_TYPE_DERIVE)
&& (ds->ds[i].type != DS_TYPE_ABSOLUTE))
+ {
+ sfree (rates);
return (-1);
return (-1);
+ }
- if (ds->ds[i].type == DS_TYPE_GAUGE)
+ if (ds->ds[i].type == DS_TYPE_GAUGE)
{
status = ssnprintf (buffer + offset, buffer_len - offset,
",%lf", vl->values[i].gauge);
{
status = ssnprintf (buffer + offset, buffer_len - offset,
",%lf", vl->values[i].gauge);
- }
+ }
else if (store_rates != 0)
{
if (rates == NULL)
else if (store_rates != 0)
{
if (rates == NULL)
@@
-185,7
+187,7
@@
static int value_list_to_filename (char *buffer, size_t buffer_size,
static int csv_create_file (const char *filename, const data_set_t *ds)
{
FILE *csv;
static int csv_create_file (const char *filename, const data_set_t *ds)
{
FILE *csv;
-
in
t i;
+
size_
t i;
if (check_create_dir (filename))
return (-1);
if (check_create_dir (filename))
return (-1);