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;
int ds_num;
int status = 0;
time_t last_up;
+ unsigned long stepsize;
if (check_create_dir (filename))
return (-1);
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;
+ 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
- last_up = CDTIME_T_TO_TIME_T (vl->time) - 10;
+ stepsize = (unsigned long) CDTIME_T_TO_TIME_T (vl->interval);
- assert (vl->time > 10);
- status = srrd_create (filename,
- (cfg->stepsize > 0) ? cfg->stepsize : vl->interval,
- last_up,
+ status = srrd_create (filename, stepsize, last_up,
argc, (const char **) argv);
free (argv);