* rrd_create.c creates new rrds
*****************************************************************************/
+#include <locale.h>
+
#include "rrd_tool.h"
#include "rrd_rpncalc.h"
#include "rrd_hw.h"
}
/* set some defaults */
- strcpy(rrd.stat_head->cookie, RRD_COOKIE);
- strcpy(rrd.stat_head->version, RRD_VERSION);
+ strcpy(rrd.stat_head->cookie, RRD_COOKIE);
+ strcpy(rrd.stat_head->version, RRD_VERSION3); /* by default we are still version 3 */
rrd.stat_head->float_cookie = FLOAT_COOKIE;
rrd.stat_head->ds_cnt = 0; /* this will be adjusted later */
rrd.stat_head->rra_cnt = 0; /* ditto */
rrd_set_error("Failed to parse CF name");
switch (cf_conv
(rrd.rra_def[rrd.stat_head->rra_cnt].cf_nam)) {
- case CF_HWPREDICT:
case CF_MHWPREDICT:
+ strcpy(rrd.stat_head->version, RRD_VERSION); /* MHWPREDICT causes Version 4 */
+ case CF_HWPREDICT:
/* initialize some parameters */
rrd.rra_def[rrd.stat_head->rra_cnt].par[RRA_hw_alpha].
u_val = 0.1;
int ds_idx)
{
char minstr[DS_NAM_SIZE], maxstr[DS_NAM_SIZE];
-
+ char *old_locale;
/*
int temp;
&(rrd -> ds_def[ds_idx].par[DS_mrhb_cnt].u_cnt),
minstr,maxstr);
*/
+ old_locale = setlocale(LC_NUMERIC,"C");
if (sscanf(def, "%lu:%18[^:]:%18[^:]",
&(rrd->ds_def[ds_idx].par[DS_mrhb_cnt].u_cnt),
minstr, maxstr) == 3) {
rrd->ds_def[ds_idx].par[DS_min_val].u_val
>= rrd->ds_def[ds_idx].par[DS_max_val].u_val) {
rrd_set_error("min must be less than max in DS definition");
+ setlocale(LC_NUMERIC,old_locale);
return;
}
} else {
rrd_set_error("failed to parse data source %s", def);
}
+ setlocale(LC_NUMERIC,old_locale);
}
/* Create the CF_DEVPREDICT, CF_DEVSEASONAL, CF_SEASONAL, and CF_FAILURES RRAs