node_state, XML_CIB_ATTR_JOINSTATE); 
node_state, XML_CIB_ATTR_CRMDSTATE); 
extract_event(xmlNodePtr msg){	gboolean abort      = FALSE;	xmlNodePtr iter     = NULL;	const char *section = NULL;	const char *event_action = NULL;	const char *event_node   = NULL;	const char *event_rsc    = NULL;	const char *event_status = NULL;	const char *event_rc     = NULL;	/*[cib fragment]...<status>   <node_state id="node1" state=CRMD_STATE_ACTIVE exp_state="active">     <lrm>       <lrm_resources>	 <rsc_state id="" rsc_id="rsc4" node_id="node1" rsc_state="stopped"/>*/	iter = find_xml_node(msg, XML_TAG_FRAGMENT);	section = xmlGetProp(iter, XML_ATTR_SECTION);	if(safe_str_neq(section, XML_CIB_TAG_STATUS)) {		// these too are never expected		return FALSE;	}		iter = find_xml_node(iter, XML_TAG_CIB);	iter = get_object_root(XML_CIB_TAG_STATUS, iter);	iter = iter->children;		while(abort == FALSE && iter != NULL) {		xmlNodePtr node_state = iter;		xmlNodePtr child = iter->children;		const char *state = xmlGetProp(			node_state, XML_CIB_ATTR_JOINSTATE);		iter = iter->next;		if(xmlGetProp(node_state, XML_CIB_ATTR_SHUTDOWN) != NULL		   || xmlGetProp(node_state, XML_CIB_ATTR_STONITH) != NULL) {			abort = TRUE;					} else if(state != NULL && child == NULL) {			/* node state update,			 * possibly from a shutdown we requested			 */			event_status = state;			event_node   = xmlGetProp(node_state, XML_ATTR_ID);						if(safe_str_eq(event_status, CRMD_JOINSTATE_DOWN)) {				event_action = XML_CIB_ATTR_SHUTDOWN;			} else {				// never expected... yet.  STONITH?				event_action = "startup";			}						abort = !process_graph_event(event_node,						     event_rsc,						     event_action,						     event_status,						     event_rc);		} else if(state == NULL && child != NULL) {			child = find_xml_node(node_state, XML_CIB_TAG_LRM);			child = find_xml_node(child, XML_LRM_TAG_RESOURCES);			if(child != NULL) {				child = child->children;			} else {				abort = TRUE;			}						while(abort == FALSE && child != NULL) {				event_action = xmlGetProp(					child, XML_LRM_ATTR_LASTOP);				event_node   = xmlGetProp(					child, XML_LRM_ATTR_TARGET);				event_rsc    = xmlGetProp(					child, XML_ATTR_ID);				event_status = xmlGetProp(					child, XML_LRM_ATTR_OPSTATE);				event_rc     = xmlGetProp(					child, XML_LRM_ATTR_OPCODE);								abort = !process_graph_event(event_node,							     event_rsc,							     event_action,							     event_status,							     event_rc);				child = child->next;			}			} else if(state != NULL && child != NULL) {			/* this is a complex event and could not be completely			 * due to any request we made			 */			abort = TRUE;					} else {			/* ignore */		}	}		return !abort;}
8182	/local/tlutelli/issta_data/temp/c/2005_temp/2005/8182/ead633eb23a5e8206743fb4f7634ad71518a2631/tengine.c/buggy/crm/tengine/tengine.c