]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-bdb/idl.c
Sync with HEAD as of 14-March-2004
[openldap] / servers / slapd / back-bdb / idl.c
index 42bd02dbe2c39888d297742dd040ba364e95df37..d6a29083d641719cecf2c567ee33c91c6de4f58e 100644 (file)
@@ -1,8 +1,17 @@
 /* idl.c - ldap id list handling routines */
 /* $OpenLDAP$ */
-/*
- * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
- * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
+ *
+ * Copyright 2000-2004 The OpenLDAP Foundation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.
+ *
+ * A copy of this license is available in the file LICENSE in the
+ * top-level directory of the distribution or, alternatively, at
+ * <http://www.OpenLDAP.org/license.html>.
  */
 
 #include "portable.h"
        }                                                               \
 } while ( 0 )
 
-int
+static int
 bdb_idl_entry_cmp( const void *v_idl1, const void *v_idl2 )
 {
        const bdb_idl_cache_entry_t *idl1 = v_idl1, *idl2 = v_idl2;
        int rc;
 
-       if ((rc = idl1->db - idl2->db )) return rc;
+       if ((rc = SLAP_PTRCMP( idl1->db, idl2->db ))) return rc;
        if ((rc = idl1->kstr.bv_len - idl2->kstr.bv_len )) return rc;
        return ( memcmp ( idl1->kstr.bv_val, idl2->kstr.bv_val , idl1->kstr.bv_len ) );
 }
@@ -344,6 +353,8 @@ bdb_idl_cache_put(
        bdb_idl_cache_entry_t idl_tmp;
        bdb_idl_cache_entry_t *ee;
 
+       DBT2bv( key, &idl_tmp.kstr );
+
        ee = (bdb_idl_cache_entry_t *) ch_malloc(
                sizeof( bdb_idl_cache_entry_t ) );
        ee->db = db;