Update of /cvsroot/perfparse/_perfparse/modules
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21824/modules
Modified Files:
storage_mysql.c
Log Message:
replace macro with function should make code make better to debug - and probably even smaller.
Index: storage_mysql.c
===================================================================
RCS file: /cvsroot/perfparse/_perfparse/modules/storage_mysql.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** storage_mysql.c 15 Dec 2007 23:30:56 -0000 1.19
--- storage_mysql.c 17 Dec 2007 20:49:53 -0000 1.20
***************
*** 420,424 ****
! t_raw_policyinfo *raw_policyinfo=NULL;
g_string_printf(s_SQL,"SELECT service_id,service_description,host_id,policy_name,delete_policy_seconds,raw_delete_policy_individual FROM perfdata_service s LEFT JOIN perfdata_delete_policy d ON s.raw_delete_policy_id=d.policy_id");
--- 420,424 ----
! t_policyinfo *raw_policyinfo=NULL;
g_string_printf(s_SQL,"SELECT service_id,service_description,host_id,policy_name,delete_policy_seconds,raw_delete_policy_individual FROM perfdata_service s LEFT JOIN perfdata_delete_policy d ON s.raw_delete_policy_id=d.policy_id");
***************
*** 426,430 ****
while ((result_row = mysql_fetch_row(query_result))) {
! raw_policyinfo = (t_raw_policyinfo *)malloc(sizeof(t_raw_policyinfo));
raw_policyinfo->iPolicySource=DEL_POLICY_SOURCE_NONE;
raw_policyinfo->iServiceId = iData(0);
--- 426,430 ----
while ((result_row = mysql_fetch_row(query_result))) {
! raw_policyinfo = (t_policyinfo *)malloc(sizeof(t_policyinfo));
raw_policyinfo->iPolicySource=DEL_POLICY_SOURCE_NONE;
raw_policyinfo->iServiceId = iData(0);
***************
*** 448,452 ****
while(tmplist2) {
! raw_policyinfo=(t_raw_policyinfo *) tmplist2->data;
if(raw_policyinfo->iPolicySource==DEL_POLICY_SOURCE_NONE) { // get policy info from host or hostgroup
getRawHostPolicy(raw_policyinfo);
--- 448,452 ----
while(tmplist2) {
! raw_policyinfo=(t_policyinfo *) tmplist2->data;
if(raw_policyinfo->iPolicySource==DEL_POLICY_SOURCE_NONE) { // get policy info from host or hostgroup
getRawHostPolicy(raw_policyinfo);
***************
*** 462,466 ****
if(raw_policyinfo->iPolicySeconds>1) {
dps=t-raw_policyinfo->iPolicySeconds;
! pp_log(__FILE__,__LINE__,LOG_INFO,_("Purging raw data older than %s from service %s Id %d due to "),
asctime(localtime(&dps)),raw_policyinfo->sServiceDesc,
raw_policyinfo->iServiceId);
--- 462,466 ----
if(raw_policyinfo->iPolicySeconds>1) {
dps=t-raw_policyinfo->iPolicySeconds;
! pp_log(__FILE__,__LINE__,LOG_INFO,_("Purging raw data older than %s from service '%s', ServiceId %d due to "),
asctime(localtime(&dps)),raw_policyinfo->sServiceDesc,
raw_policyinfo->iServiceId);
***************
*** 484,487 ****
--- 484,489 ----
pp_log(__FILE__,__LINE__,LOG_INFO,_("group '%s' setting in hostgroup.\n"),raw_policyinfo->sPolicyName);
break;
+ case DEL_POLICY_SOURCE_DEFAULT:
+ pp_log_fl(LOG_INFO,_("default setting.\n"));
default:
pp_log(__FILE__,__LINE__,LOG_FATAL,_("This is a error. This line should not be executed.\n"));
|