From: Ralf Haferkamp Date: Wed, 27 Sep 2006 10:51:06 +0000 (+0000) Subject: Check for the correct return code of cursor->c_get() (DB_BUFFER_SMALL) X-Git-Tag: OPENLDAP_REL_ENG_2_3_MP~89 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e1f068f712a109b0fd906bcd8da65ec6887e4bc0;p=openldap Check for the correct return code of cursor->c_get() (DB_BUFFER_SMALL) --- diff --git a/servers/slapd/back-bdb/id2entry.c b/servers/slapd/back-bdb/id2entry.c index 3c5580ea9c..8e670b955d 100644 --- a/servers/slapd/back-bdb/id2entry.c +++ b/servers/slapd/back-bdb/id2entry.c @@ -130,6 +130,7 @@ int bdb_id2entry( rc = cursor->c_get( cursor, &key, &data, DB_SET ); if ( rc ) goto leave; + eh.bv.bv_val = buf; eh.bv.bv_len = data.size; rc = entry_header( &eh ); @@ -139,7 +140,7 @@ int bdb_id2entry( data.flags ^= DB_DBT_PARTIAL; data.ulen = 0; rc = cursor->c_get( cursor, &key, &data, DB_CURRENT ); - if ( rc != ENOMEM ) goto leave; + if ( rc != DB_BUFFER_SMALL ) goto leave; /* Allocate a block and retrieve the data */ off = eh.data - eh.bv.bv_val; diff --git a/servers/slapd/back-bdb/tools.c b/servers/slapd/back-bdb/tools.c index e16be3f66b..293beca6cf 100644 --- a/servers/slapd/back-bdb/tools.c +++ b/servers/slapd/back-bdb/tools.c @@ -273,7 +273,7 @@ Entry* bdb_tool_entry_get( BackendDB *be, ID id ) data.flags ^= DB_DBT_PARTIAL; data.ulen = 0; rc = cursor->c_get( cursor, &key, &data, DB_CURRENT ); - if ( rc != ENOMEM ) goto leave; + if ( rc != DB_BUFFER_SMALL ) goto leave; /* Allocate a block and retrieve the data */ eh.bv.bv_len = eh.nvals * sizeof( struct berval ) + data.size;