DBT key; DBT data;
SECKEY_ResetKeyDB(SECKEYKeyDBHandle *handle){    SECStatus rv;    DBT key;    DBT data;    int ret;    int errors = 0;    if ( handle->db == NULL ) {	return(SECSuccess);    }    if (handle->readOnly) {	/* set an error code */	return SECFailure;     }    PORT_Assert(handle->dbname != NULL);    if (handle->dbname == NULL) {	return SECFailure;    }    (* handle->db->close)(handle->db);    handle->db = dbopen( handle->dbname,			     O_RDWR | O_CREAT | O_TRUNC, 0600, DB_HASH, 0 );    if (handle->db == NULL) {	/* set an error code */	return SECFailure;    }        rv = makeGlobalVersion(handle);    if ( rv != SECSuccess ) {	errors++;	goto done;    }    rv = makeGlobalSalt(handle);    if ( rv != SECSuccess ) {	errors++;	goto done;    }    if (handle->global_salt) {	SECITEM_FreeItem(handle->global_salt,PR_TRUE);    }    handle->global_salt = GetKeyDBGlobalSalt(handle);done:    /* sync the database */    ret = (* handle->db->sync)(handle->db, 0);    return (errors == 0 ? SECSuccess : SECFailure);}