mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-03-07 14:18:15 +08:00
Fix idl_insert_key() return codes.
This commit is contained in:
parent
f252bde681
commit
6b80f345a4
@ -471,7 +471,8 @@ idl_insert_key(
|
||||
rc = idl_change_first( be, db, key, idl, i, k2, tmp );
|
||||
break;
|
||||
|
||||
case 2: /* id not inserted - already there */
|
||||
case 2: /* id not inserted - already there, do nothing */
|
||||
rc = 0;
|
||||
break;
|
||||
|
||||
case 3: /* id not inserted - block is full */
|
||||
@ -492,7 +493,8 @@ idl_insert_key(
|
||||
Debug( LDAP_DEBUG_ANY,
|
||||
"idl_fetch_one (%s) returns NULL\n",
|
||||
k2.dptr, 0, 0 );
|
||||
break;
|
||||
/* split the original block */
|
||||
goto split;
|
||||
}
|
||||
|
||||
switch ( (rc = idl_insert( &tmp2, id,
|
||||
@ -518,14 +520,19 @@ idl_insert_key(
|
||||
case 3: /* split the original block */
|
||||
break;
|
||||
}
|
||||
|
||||
idl_free( tmp2 );
|
||||
}
|
||||
|
||||
split:
|
||||
/*
|
||||
* must split the block, write both new blocks + update
|
||||
* and write the indirect header block.
|
||||
*/
|
||||
|
||||
rc = 0; /* optimistic */
|
||||
|
||||
|
||||
/* count how many indirect blocks *//* XXX linear count XXX */
|
||||
for ( j = 0; !ID_BLOCK_NOID(idl, j); j++ )
|
||||
; /* NULL */
|
||||
|
Loading…
Reference in New Issue
Block a user