FNIN(); 
activateCibXml(xmlNodePtr new_cib, const char *filename){	int error_code = 0;	xmlNodePtr saved_cib = get_the_CIB();	const char *filename_bak = CIB_BACKUP; // calculate	xmlDocPtr foo;	FNIN();	if (initializeCib(new_cib) == TRUE) {		int res = moveFile(filename, filename_bak, FALSE, NULL);			if (res  < 0) {			crm_info("Could not make backup of the current Cib "				 "(code: %d)... aborting update.", res);			error_code = -1;		} else {			crm_info("Writing CIB out to %s", CIB_FILENAME);	    			if (new_cib->doc == NULL) {				foo = xmlNewDoc("1.0");				xmlDocSetRootElement(foo, new_cib);				xmlSetTreeDoc(new_cib,foo);			}			time_t now = time(NULL);			char *now_str = asctime(localtime(&now));			set_xml_property_copy(new_cib, "last_written",now_str);			free(now_str);						/* save it.			 * set arg 3 to 0 to disable line breaks,1 to enable			 * res == num bytes saved			 */			res = xmlSaveFormatFile(filename,						new_cib->doc,						1);						/* for some reason, reading back after saving with			 * line-breaks doesnt go real well 			 */			crm_info("Saved %d bytes to the Cib as XML",				 res);	    			if (res < 0) {				// assume 0 is good				if (moveFile(filename_bak,					     filename,					     FALSE,					     NULL) < -1) {					crm_crit("Could not restore the "						 "backup of the current Cib "						 "(code: %d)... panic!",						 res);					error_code = -2;					// should probably exit here 				} else if (initializeCib(saved_cib) == FALSE) {					// oh we are so dead 					crm_crit("Could not re-initialize "						 "with the old CIB.  "						 "Everything is about to go "						 "pear shaped");					error_code = -3;				} else {					crm_crit("Update of Cib failed "						 "(code: %d)... reverted to "						 "last known valid version",						 res);										error_code = -4;				}			}		}	}	else	{		crm_info("Ignoring invalid or NULL Cib");		error_code = -5;	}// Make sure memory is cleaned up appropriately	if (error_code != 0) {		crm_trace("Freeing new CIB %p", new_cib);		free_xml(new_cib);	} else {		crm_trace("Freeing saved CIB %p", saved_cib);		free_xml(saved_cib);	}	FNRET(error_code);    }
8182	/local/tlutelli/issta_data/temp/c/2005_temp/2005/8182/e096a2906dea1664d64bb7bb2c0e2f5d325541e7/cibio.c/buggy/crm/cib/cibio.c