 message_timer_id = Gmain_timeout_add( message_timeout_ms, admin_message_timeout, NULL);  
admin_msg_callback(IPC_Channel * server, void *private_data){	int lpc = 0;	IPC_Message *msg = NULL;	gboolean hack_return_good = TRUE;	static int received_responses = 0;	char *filename;	int filename_len = 0;	const char *result = NULL;	xmlNodePtr options = NULL;	xmlNodePtr xml_root_node = NULL;	char *buffer = NULL;	while (server->ch_status != IPC_DISCONNECT	       && server->ops->is_message_pending(server) == TRUE) {		if (server->ops->recv(server, &msg) != IPC_OK) {			perror("Receive failure:");			return !hack_return_good;		}		if (msg == NULL) {			crm_trace("No message this time");			continue;		}		lpc++;		buffer =(char *) msg->msg_body;		crm_verbose("Got xml [text=%s]", buffer);		xml_root_node = find_xml_in_ipcmessage(msg, TRUE);		if (xml_root_node == NULL) {			crm_info(			       "XML in IPC message was not valid... "			       "discarding.");			continue;		} else if (validate_crm_message(xml_root_node,					 crm_system_name,					 admin_uuid,					 "response") == FALSE) {			crm_info(			       "Message was not a CRM response. Discarding.");			continue;		}		options = find_xml_node(xml_root_node, XML_TAG_OPTIONS);				result = xmlGetProp(options, XML_ATTR_RESULT);		if(result == NULL || strcmp(result, "ok") == 0) {			result = "pass";		} else {			result = "fail";		}				received_responses++;		crm_xml_devel(xml_root_node, cib_action);		buffer = dump_xml_formatted(xml_root_node);		fprintf(stderr, "%s", crm_str(buffer));		crm_free(buffer);		if (this_msg_reference != NULL) {			/* in testing mode... */			/* 31 = "test-_.xml" + an_int_as_string + '\0' */			filename_len = 31 + strlen(this_msg_reference);			crm_malloc(filename, sizeof(char) * filename_len);			if(filename != NULL) {				sprintf(filename, "%s-%s_%d.xml",					result, this_msg_reference,					received_responses);								filename[filename_len - 1] = '\0';				if (xmlSaveFormatFile(					    filename, xml_root_node->doc, 1) < 0) {					crm_crit("Could not save response to"						 " %s_%s_%d.xml",						 this_msg_reference,						 result, received_responses);				}			}		}	}	if (server->ch_status == IPC_DISCONNECT) {		crm_info("admin_msg_callback: received HUP");		return !hack_return_good;	}	if (received_responses >= expected_responses) {		crm_info(		       "Recieved expected number (%d) of messages from Heartbeat."		       "  Exiting normally.", expected_responses);		g_main_quit(mainloop);		return !hack_return_good;	}	return hack_return_good;}
8182	/local/tlutelli/issta_data/temp/c/2005_temp/2005/8182/3aa0d54934a68a3d5cd65229b1b8966652e50c74/cibadmin.c/buggy/crm/admin/cibadmin.c