activateCibXml(xmlNodePtr cib)
activateCibXml(xmlNodePtr new_cib)
activateCibXml(xmlNodePtr cib){    if(cib != NULL)    {	if(initializeCib(cib) == FALSE) FNRET(-5);		int res = moveFile(CIB_FILENAME, CIB_BACKUP, FALSE, NULL);		if(res  < 0)	{	    cl_log(LOG_INFO, "Could not make backup of the current Cib (code: %d)... aborting update.", res);	    FNRET(-1);	}	 	// modify the timestamp	xmlSetProp(cib, XML_ATTR_TSTAMP, getNow());        		cl_log(LOG_INFO, "Writing CIB out to %s", CIB_FILENAME);	if(cib->doc == NULL)	{	    cl_log(LOG_INFO, "Writing of a NULL document will fail, creating a new back link.");	    xmlDocPtr foo = xmlNewDoc("1.0");	    foo->children = cib;	    cib->doc = foo;	}		// save it.  set arg 3 to 0 to disable line breaks	res = xmlSaveFormatFile(CIB_FILENAME, cib->doc, 0);	// for some reason, reading back after saving with formating doesnt go real well //	res = xmlSaveFile(CIB_FILENAME, cib->doc);		// res == num bytes saved	cl_log(LOG_INFO, "Saved %d bytes to the Cib as XML", res);		if(res < 0) // assume 0 is good	{	    if(moveFile(CIB_BACKUP, CIB_FILENAME, FALSE, NULL) < -1)	    {		cl_log(LOG_CRIT, "Could not restore the backup of the current Cib (code: %d)... panic!", res);		FNRET(-2);		// should probably exit here 	    }	    	    cl_log(LOG_CRIT, "Update of Cib failed (code: %d)... reverted to last known valid version", res);	    FNRET(-3);	}    }    else    {	cl_log(LOG_INFO, "Ignoring invalid NULL Cib XML");	FNRET(-4);    }    FNRET(0);    }