]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-ldbm/id2children.c
When recreating a database from an ldif file created by ldbmcat,
[openldap] / servers / slapd / back-ldbm / id2children.c
index 978fd9a4b7c9450b7b83d7826767d3aa5e41abce..55b9d8d5189d3e3c5688f8bfdb08b7505494f7fc 100644 (file)
@@ -17,15 +17,13 @@ id2children_add(
     Entry      *e
 )
 {
-       struct dbcache  *db;
+       DBCache *db;
        Datum           key;
-       int             len, rc;
-       ID_BLOCK                *idl;
        char            buf[20];
 
        ldbm_datum_init( key );
 
-       Debug( LDAP_DEBUG_TRACE, "=> id2children_add( %lu, %lu )\n",
+       Debug( LDAP_DEBUG_TRACE, "=> id2children_add( %ld, %ld )\n",
               p ? p->e_id : 0, e->e_id, 0 );
 
        if ( (db = ldbm_cache_open( be, "id2children", LDBM_SUFFIX,
@@ -61,13 +59,11 @@ id2children_remove(
     Entry      *e
 )
 {
-       struct dbcache  *db;
+       DBCache *db;
        Datum           key;
-       int             len, rc;
-       ID_BLOCK                *idl;
        char            buf[20];
 
-       Debug( LDAP_DEBUG_TRACE, "=> id2children_remove( %lu, %lu )\n", p ? p->e_id
+       Debug( LDAP_DEBUG_TRACE, "=> id2children_remove( %ld, %ld )\n", p ? p->e_id
            : 0, e->e_id, 0 );
 
        if ( (db = ldbm_cache_open( be, "id2children", LDBM_SUFFIX,
@@ -84,10 +80,17 @@ id2children_remove(
        key.dsize = strlen( buf ) + 1;
 
        if ( idl_delete_key( be, db, key, e->e_id ) != 0 ) {
-               Debug( LDAP_DEBUG_TRACE, "<= id2children_remove -1 (idl_delete)\n",
+#if 0
+               Debug( LDAP_DEBUG_ANY,
+                       "<= id2children_remove: idl_delete_key failure\n",
                    0, 0, 0 );
                ldbm_cache_close( be, db );
                return( -1 );
+#else
+               Debug( LDAP_DEBUG_ANY,
+                       "<= id2children_remove: ignoring idl_delete_key failure\n",
+                   0, 0, 0 );
+#endif
        }
 
        ldbm_cache_close( be, db );
@@ -102,15 +105,15 @@ has_children(
     Entry      *p
 )
 {
-       struct dbcache  *db;
+       DBCache *db;
        Datum           key;
-       int             rc = 1;
+       int             rc = 0;
        ID_BLOCK                *idl;
        char            buf[20];
 
        ldbm_datum_init( key );
 
-       Debug( LDAP_DEBUG_TRACE, "=> has_children( %lu )\n", p->e_id , 0, 0 );
+       Debug( LDAP_DEBUG_TRACE, "=> has_children( %ld )\n", p->e_id , 0, 0 );
 
        if ( (db = ldbm_cache_open( be, "id2children", LDBM_SUFFIX,
            LDBM_WRCREAT )) == NULL ) {
@@ -130,10 +133,10 @@ has_children(
 
        if( idl != NULL ) {
                idl_free( idl );
-               rc = 0;
+               rc = 1;
        }
 
-       Debug( LDAP_DEBUG_TRACE, "<= has_children( %lu ): %s\n",
+       Debug( LDAP_DEBUG_TRACE, "<= has_children( %ld ): %s\n",
                p->e_id, rc ? "yes" : "no", 0 );
        return( rc );
 }