msg_te_strm = fopen(DEVEL_DIR"/te.log", "w");
te_update_confirm(const char *event, HA_Message *msg){	int rc = -1;	gboolean done = FALSE;	const char *op = cl_get_string(msg, F_CIB_OPERATION);	const char *type = cl_get_string(msg, F_CIB_OBJTYPE);	const char *update_s = cl_get_string(msg, F_CIB_UPDATE);	xmlNodePtr update = string2xml(update_s);	ha_msg_value_int(msg, F_CIB_RC, &rc);	crm_trace("Processing %s...", event);	crm_xml_devel(update, "Processing update");		if (MSG_LOG && msg_te_strm == NULL) {		struct stat buf;		if(stat(DEVEL_DIR, &buf) != 0) {			cl_perror("Stat of %s failed... exiting", DEVEL_DIR);			exit(100);		}		msg_te_strm = fopen(DEVEL_DIR"/te.log", "w");	}		if(op == NULL) {		crm_err(			"Illegal CIB update, the operation must be specified");		send_abort("Illegal update", update);		done = TRUE;			} else if(strcmp(op, CRM_OP_CIB_CREATE) == 0		  || strcmp(op, CRM_OP_CIB_DELETE) == 0		  || strcmp(op, CRM_OP_CIB_REPLACE) == 0		  || strcmp(op, CRM_OP_SHUTDOWN_REQ) == 0		  || strcmp(op, CRM_OP_CIB_ERASE) == 0) {				/* these are always unexpected, trigger the PE */		send_abort("Non-update change", update);		done = TRUE;			} else if(strcmp(op, CRM_OP_CIB_UPDATE) != 0) {		crm_verbose("Ignoring %s op confirmation", op);		done = TRUE;	}	if(done) {		free_xml(update);		return;	}		if(safe_str_eq(type, XML_CIB_TAG_CRMCONFIG)) {		/* ignore - for the moment */		crm_debug("Ignoring changes to the %s section", type);			} else if(safe_str_eq(type, XML_CIB_TAG_STATUS)) {		/* this _may_ not be un-expected */		extract_event(update);	} else if(safe_str_eq(type, XML_CIB_TAG_NODES)		|| safe_str_eq(type, XML_CIB_TAG_RESOURCES)		|| safe_str_eq(type, XML_CIB_TAG_CONSTRAINTS)) {		/* these are never expected	 */		crm_debug("Aborting on changes to the %s section", type);		send_abort("Non-status update", update);	} else {		crm_warn("Ignoring update confirmation for %s object", type);	}	free_xml(update);}