projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Attempt to fix collectd/collectd#229 by doing user / group lookups before we fork.
[collectd.git]
/
src
/
utils_rrdcreate.c
diff --git
a/src/utils_rrdcreate.c
b/src/utils_rrdcreate.c
index
7a389f2
..
091b5fa
100644
(file)
--- a/
src/utils_rrdcreate.c
+++ b/
src/utils_rrdcreate.c
@@
-156,7
+156,7
@@
static int rra_get (char ***ret, const value_list_t *vl, /* {{{ */
if (rra_num >= rra_max)
break;
if (rra_num >= rra_max)
break;
- status = ssnprintf (buffer, sizeof (buffer), "RRA:%s:%
3.1
f:%u:%u",
+ status = ssnprintf (buffer, sizeof (buffer), "RRA:%s:%
.10
f:%u:%u",
rra_types[j], cfg->xff, cdp_len, cdp_num);
if ((status < 0) || ((size_t) status >= sizeof (buffer)))
rra_types[j], cfg->xff, cdp_len, cdp_num);
if ((status < 0) || ((size_t) status >= sizeof (buffer)))
@@
-374,7
+374,7
@@
int cu_rrd_create_file (const char *filename, /* {{{ */
int ds_num;
int status = 0;
time_t last_up;
int ds_num;
int status = 0;
time_t last_up;
-
int
stepsize;
+
unsigned long
stepsize;
if (check_create_dir (filename))
return (-1);
if (check_create_dir (filename))
return (-1);
@@
-405,19
+405,17
@@
int cu_rrd_create_file (const char *filename, /* {{{ */
memcpy (argv + ds_num, rra_def, rra_num * sizeof (char *));
argv[ds_num + rra_num] = NULL;
memcpy (argv + ds_num, rra_def, rra_num * sizeof (char *));
argv[ds_num + rra_num] = NULL;
- if (vl->time == 0)
- last_up = time (NULL) - 10;
- else
-
last_up = CDTIME_T_TO_TIME_T (vl->time) - 10
;
+ last_up = CDTIME_T_TO_TIME_T (vl->time);
+ if (last_up <= 0)
+ last_up = time (NULL);
+
last_up -= 1
;
if (cfg->stepsize > 0)
stepsize = cfg->stepsize;
else
if (cfg->stepsize > 0)
stepsize = cfg->stepsize;
else
- stepsize = (
int
) CDTIME_T_TO_TIME_T (vl->interval);
+ stepsize = (
unsigned long
) CDTIME_T_TO_TIME_T (vl->interval);
- assert (vl->time > 10);
- status = srrd_create (filename,
- stepsize, last_up,
+ status = srrd_create (filename, stepsize, last_up,
argc, (const char **) argv);
free (argv);
argc, (const char **) argv);
free (argv);