From 07b2fb45a4e1304e610b4711ad65eedf80464478 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Mon, 28 May 2007 18:47:19 +0200 Subject: [PATCH] db_get: handle recent (DB 4.3) DB_BUFFER_SMALL error return --- common/db.c | 2 +- common/db.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/common/db.c b/common/db.c index 0b2ffbe9..38932946 100644 --- a/common/db.c +++ b/common/db.c @@ -170,7 +170,7 @@ retry: data.ulen = sp->c_blen; data.flags = DB_DBT_USERMEM; switch (ep->db->get(ep->db, NULL, &key, &data, 0)) { - case ENOMEM: + case DB_BUFFER_SMALL: nlen = data.size; goto retry; default: diff --git a/common/db.h b/common/db.h index d405ffeb..fd1dc646 100644 --- a/common/db.h +++ b/common/db.h @@ -1,5 +1,9 @@ #include +#ifndef DB_BUFFER_SMALL +#define DB_BUFFER_SMALL ENOMEM +#endif + #if DB_VERSION_MAJOR >= 3 && DB_VERSION_MINOR >= 1 #define db_env_open(env,path,flags,mode) \ (env)->open(env, path, flags, mode) -- 2.11.4.GIT