if (moveFile(filename_bak, filename, FALSE,NULL) < -1){ 
CRM_DEV_ASSERT(moveFile(filename_bak, filename, FALSE, NULL) >= 0); if (crm_assert_failed){ 
activateCibXml(crm_data_t *new_cib, const char *filename){	int error_code = cib_ok;	crm_data_t *saved_cib = get_the_CIB();	const char *filename_bak = CIB_BACKUP; /* calculate */	crm_xml_debug(new_cib, "Attempting to activate CIB");	CRM_ASSERT(new_cib != saved_cib);	crm_validate_data(new_cib);	if(saved_cib != NULL) {		crm_validate_data(saved_cib);	}		if (initializeCib(new_cib) == FALSE) {		crm_warn("Ignoring invalid or NULL Cib");		error_code = -5;	} else if(cib_writes_enabled) {		int res = 0;		if(saved_cib != NULL) {			res = moveFile(filename, filename_bak, FALSE, NULL);						if (res < 0) {				crm_warn("Could not make backup of the current Cib "					 "(code: %d)... aborting update.", res);				error_code = -1;				CRM_DEV_ASSERT(FALSE);			}		}				if(error_code == cib_ok) {			crm_debug("Writing CIB out to %s", CIB_FILENAME);			res = write_xml_file(new_cib, CIB_FILENAME);			if (res < 0) {				error_code = -4;				CRM_DEV_ASSERT(FALSE);			}		}		if(error_code == -4 && saved_cib != NULL) {			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  */				CRM_DEV_ASSERT(FALSE);			}		}		if(saved_cib == NULL && error_code != cib_ok) {			/* oh we are so dead  */			crm_crit("Could not write out new CIB and no saved"				 " version to revert to");				error_code = -3;							CRM_DEV_ASSERT(FALSE);		} else if(error_code != cib_ok) {			crm_crit("Update of Cib failed (%d)... reverting"				 " to last known valid version",				 error_code);			if (initializeCib(saved_cib) == FALSE) {				/* oh we are so dead  */				crm_crit("Could not re-initialize with the old"					 " CIB.  Can anyone say corruption?");				error_code = -3;				CRM_DEV_ASSERT(FALSE);			}		}	}	/* Make sure memory is cleaned up appropriately */	if (error_code != cib_ok) {		crm_trace("Freeing new CIB %p", new_cib);		free_xml(new_cib);			} else if(saved_cib != NULL) {		crm_trace("Freeing saved CIB %p", saved_cib);		crm_validate_data(saved_cib);		free_xml(saved_cib);	}	return error_code;    }
8182	/local/tlutelli/issta_data/temp/c/2005_temp/2005/8182/fce57f2d502baff18e566d8c6603bef5ab3b2a2c/io.c/buggy/crm/cib/io.c