 res = xmlSaveFile(CIB_FILENAME, cib->doc); 
cl_log(LOG_INFO, "Writing CIB out to %s", CIB_FILENAME);  if(cib->doc == NULL) { cl_log(LOG_ERR, "Writing of a NULL document will fail, creating a new back link."); xmlDocPtr foo = xmlNewDoc("1.0"); foo->children = cib; cib->doc = foo; }    res = xmlSaveFormatFile(CIB_FILENAME, cib->doc, 0);    
activateCibXml(xmlNodePtr cib){    if(cib != NULL)    {	if(initializeCib(cib) == FALSE) return -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);	    return -1;	}	 	// modify the timestamp	xmlSetProp(cib, XML_ATTR_TSTAMP, getNow());        		// save it	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);		return -2;		// should probably exit here 	    }	    	    cl_log(LOG_CRIT, "Update of Cib failed (code: %d)... reverted to last known valid version", res);	    return -3;	}    }    else    {	cl_log(LOG_INFO, "Ignoring invalid Cib XML");	return -4;    }    return 0;    }
8182	/local/tlutelli/issta_data/temp/c/2005_temp/2005/8182/ea49e927cf7a87359e44d087341624427b4dacc8/cibio.c/buggy/crm/cib/cibio.c