src/btree/utils.c
/*==========================================
 * newmaster -- Change master index of BTREE
 *========================================*/
- Change master index of BTREE
- Change master index of BTREE
void
newmaster (BTREE btree, INDEX master)
{
	btree->b_kfile.k_mkey = ixself(master);
	rewind(btree->b_kfp);
	if (fwrite(&btree->b_kfile, sizeof(btree->b_kfile), 1, btree->b_kfp) != 1) {
		char scratch[400];
		snprintf(scratch, sizeof(scratch), "Error rewriting master block: %s", fkey2path(ixself(master)));
		FATAL2(scratch);
	}
	btree->b_master = master;
}
void newmaster ( BTREE btree , INDEX master ) { btree -> b_kfile . k_mkey = ixself ( master ) ; rewind ( btree -> b_kfp ) ; if ( fwrite ( & btree -> b_kfile , sizeof ( btree -> b_kfile ) , 1 , btree -> b_kfp ) != 1 ) { char scratch [ 400 ] ; snprintf ( scratch , sizeof ( scratch ) , " " , fkey2path ( ixself ( master ) ) ) ; FATAL2 ( scratch ) ; } btree -> b_master = master ; }
newmaster -- Change master index of BTREE
newmaster -- Change master index of BTREE
/*
	Assumes our keyfile is valid
	so it is important that we got an exclusive writer lock
	*/