Code

rrdtool plugin: Fix warning about unused variable "stepsize".
[collectd.git] / src / utils_rrdcreate.c
index 5b1323886bc8a498a77ae3216df1dadd893b851b..d9cbad7326b24f2e32cd9dfe122651dbd479a5e2 100644 (file)
@@ -374,7 +374,7 @@ int cu_rrd_create_file (const char *filename, /* {{{ */
   int ds_num;
   int status = 0;
   time_t last_up;
-  int stepsize;
+  unsigned long stepsize;
 
   if (check_create_dir (filename))
     return (-1);
@@ -413,11 +413,9 @@ int cu_rrd_create_file (const char *filename, /* {{{ */
   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);
 
-  status = srrd_create (filename,
-      (cfg->stepsize > 0) ? cfg->stepsize : CDTIME_T_TO_TIME_T (vl->interval),
-      last_up,
+  status = srrd_create (filename, stepsize, last_up,
       argc, (const char **) argv);
 
   free (argv);