if(file_output_strm) { 
if(file_output_strm == NULL) { 
write_xml_file(crm_data_t *xml_node, const char *filename) {	int res = 0;	char now_str[30];	time_t now;	crm_devel("Writing XML out to %s", filename);	crm_validate_data(xml_node);	if (xml_node == NULL) {		return -1;	}	crm_validate_data(xml_node);	crm_xml_devel(xml_node, "Writing out");	crm_validate_data(xml_node);		now = time(NULL);	ctime_r(&now, now_str);	now_str[24] = EOS; /* replace the newline */	set_xml_property_copy(xml_node, "last_written", now_str);	crm_validate_data(xml_node);	#ifdef USE_LIBXML	if (xml_node->doc == NULL) {		xmlDocPtr foo = NULL;		crm_insane("Creating doc pointer for %s", xml_node->name);		foo = xmlNewDoc("1.0");		xmlDocSetRootElement(foo, xml_node);		xmlSetTreeDoc(xml_node, foo);	}	/* save it.	 * set arg 3 to 0 to disable line breaks,1 to enable	 * res == num bytes saved	 */	res = xmlSaveFormatFile(filename, xml_node->doc, 1);	/* for some reason, reading back after saving with	 * line-breaks doesnt go real well 	 */#else	{		FILE *file_output_strm = fopen(filename, "w");		char *buffer = dump_xml_formatted(xml_node);		CRM_DEV_ASSERT(buffer != NULL && strlen(buffer) > 0);		if(file_output_strm) {			res = -1;			crm_err("Cannot write to %s", filename);					} else if(buffer != NULL && strlen(buffer) > 0) {			res = fprintf(file_output_strm, "%s", buffer);			fflush(file_output_strm);		}		fclose(file_output_strm);		crm_free(buffer);	}#endif	crm_devel("Saved %d bytes to the Cib as XML", res);	return res;}
8182	/local/tlutelli/issta_data/temp/c/2005_temp/2005/8182/fe2355920ef629b6c8186d4d98765e59959d32f3/xml.c/buggy/crm/common/xml.c