From e1f068f712a109b0fd906bcd8da65ec6887e4bc0 Mon Sep 17 00:00:00 2001 From: Ralf Haferkamp Date: Wed, 27 Sep 2006 10:51:06 +0000 Subject: [PATCH] Check for the correct return code of cursor->c_get() (DB_BUFFER_SMALL) --- servers/slapd/back-bdb/id2entry.c | 3 ++- servers/slapd/back-bdb/tools.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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; -- 2.39.5