ctime_r(&now, now_str);
now_str = ctime(&now);
write_xml_file(crm_data_t *xml_node, const char *filename) {	int res = 0;	char now_str[30];	time_t now;	crm_debug_3("Writing XML out to %s", filename);	crm_validate_data(xml_node);	if (xml_node == NULL) {		return -1;	}	crm_validate_data(xml_node);	crm_log_xml_debug_4(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);		{		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(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;}