crm_err("Cannot write to %s", filename); 
cl_perror("Cannot write to %s", filename); 
write_xml_file(crm_data_t *xml_node, const char *filename) {	int res = 0;	char *now_str = NULL;	time_t now;	CRM_DEV_ASSERT(filename != NULL);	crm_debug_3("Writing XML out to %s", filename);	crm_validate_data(xml_node);	if (xml_node == NULL) {		crm_err("Cannot write NULL to %s", filename);		return -1;	}	crm_validate_data(xml_node);	crm_log_xml_debug_4(xml_node, "Writing out");	crm_validate_data(xml_node);		now = time(NULL);	now_str = ctime(&now);	now_str[24] = EOS; /* replace the newline */	crm_xml_add(xml_node, "last_written", now_str);	crm_validate_data(xml_node);		{		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 == NULL) {			res = -1;			crm_err("Cannot write to %s", filename);					} else if(buffer != NULL && strlen(buffer) > 0) {			res = fprintf(file_output_strm, "%s", buffer);			if(res < 0) {				crm_err("Cannot write output to %s", filename);			}		}		if(file_output_strm != NULL) {			fflush(file_output_strm);			fclose(file_output_strm);		}				crm_free(buffer);	}	crm_debug_3("Saved %d bytes to the Cib as XML", res);	return res;}
8182	/local/tlutelli/issta_data/temp/c/2005_temp/2005/8182/251f0eaf428af1d78dd3d18ef4cd422684a0506b/xml.c/buggy/lib/crm/common/xml.c