return (-1);
}
- ss = (cfg->stepsize > 0) ? cfg->stepsize : vl->interval;
+ if (cfg->stepsize > 0)
+ ss = cfg->stepsize;
+ else
+ ss = (int) CDTIME_T_TO_TIME_T (vl->interval);
if (ss <= 0)
{
*ret = NULL;
status = ssnprintf (buffer, sizeof (buffer),
"DS:%s:%s:%i:%s:%s",
d->name, type,
- (cfg->heartbeat > 0) ? cfg->heartbeat : (2 * vl->interval),
+ (cfg->heartbeat > 0)
+ ? cfg->heartbeat
+ : (int) CDTIME_T_TO_TIME_T (2 * vl->interval),
min, max);
if ((status < 1) || ((size_t) status >= sizeof (buffer)))
break;
last_up = time (NULL) - 10;
ssnprintf (pdp_step_str, sizeof (pdp_step_str), "%lu", pdp_step);
- ssnprintf (last_up_str, sizeof (last_up_str), "%u", (unsigned int) last_up);
+ ssnprintf (last_up_str, sizeof (last_up_str), "%lu", (unsigned long) last_up);
new_argv[0] = "create";
new_argv[1] = (void *) filename;
char **ds_def;
int ds_num;
int status = 0;
+ time_t last_up;
+ int stepsize;
if (check_create_dir (filename))
return (-1);
memcpy (argv + ds_num, rra_def, rra_num * sizeof (char *));
argv[ds_num + rra_num] = NULL;
- assert (vl->time > 10);
+ last_up = CDTIME_T_TO_TIME_T (vl->time);
+ if (last_up <= 10)
+ last_up = time (NULL);
+ last_up -= 10;
+
+ if (cfg->stepsize > 0)
+ stepsize = cfg->stepsize;
+ else
+ stepsize = (int) CDTIME_T_TO_TIME_T (vl->interval);
+
status = srrd_create (filename,
(cfg->stepsize > 0) ? cfg->stepsize : vl->interval,
- vl->time - 10,
+ last_up,
argc, (const char **) argv);
free (argv);