From 1f922db1c8e98bf5931dfb7ade9b5e0fd022b619 Mon Sep 17 00:00:00 2001 From: Philip Hazel Date: Tue, 14 Jun 2005 10:32:01 +0000 Subject: Applied Alex Kiernan's patch for the API change in BDB 4.3. --- src/ACKNOWLEDGMENTS | 5 +++-- src/src/dbfn.c | 11 +++++++++-- src/src/dbfunctions.h | 9 +++++++-- src/src/exim_dbmbuild.c | 10 ++++++++-- src/src/exim_dbutil.c | 10 ++++++++-- 5 files changed, 35 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/ACKNOWLEDGMENTS b/src/ACKNOWLEDGMENTS index 6100eef05..3e1e09b29 100644 --- a/src/ACKNOWLEDGMENTS +++ b/src/ACKNOWLEDGMENTS @@ -1,4 +1,4 @@ -$Cambridge: exim/src/ACKNOWLEDGMENTS,v 1.25 2005/06/06 19:30:18 tom Exp $ +$Cambridge: exim/src/ACKNOWLEDGMENTS,v 1.26 2005/06/14 10:32:01 ph10 Exp $ EXIM ACKNOWLEDGEMENTS @@ -20,7 +20,7 @@ relatively small patches. Philip Hazel Lists created: 20 November 2002 -Last updated: 27 April 2005 +Last updated: 14 June 2005 THE OLD LIST @@ -160,6 +160,7 @@ Bob Johannessen Patch for Sieve envelope tests bug Christian Kellner Patch for LDAP dereferencing Alex Kiernan Patch for libradius Diagnosis of milliwait clock-backwards bug + Patch for BDB 4.3 API change Tom Kistner SPA server code Writing and maintaining the content scanning extension (exiscan) diff --git a/src/src/dbfn.c b/src/src/dbfn.c index f511df5e1..928cf00f1 100644 --- a/src/src/dbfn.c +++ b/src/src/dbfn.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/dbfn.c,v 1.2 2005/01/04 10:00:42 ph10 Exp $ */ +/* $Cambridge: exim/src/src/dbfn.c,v 1.3 2005/06/14 10:32:01 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -40,12 +40,19 @@ arrange to hold the locks for the bare minimum of time. */ /* For Berkeley DB >= 2, we can define a function to be called in case of DB errors. This should help with debugging strange DB problems, e.g. getting "File -exists" when you try to open a db file. */ +exists" when you try to open a db file. The API for this function was changed +at DB release 4.3. */ #if defined(USE_DB) && defined(DB_VERSION_STRING) void +#if DB_VERSION_MAJOR > 4 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 3) +dbfn_bdb_error_callback(const DB_ENV *dbenv, const char *pfx, const char *msg) +{ +dbenv = dbenv; +#else dbfn_bdb_error_callback(const char *pfx, char *msg) { +#endif pfx = pfx; log_write(0, LOG_MAIN, "Berkeley DB error: %s", msg); } diff --git a/src/src/dbfunctions.h b/src/src/dbfunctions.h index 74c7e6127..6d2d01555 100644 --- a/src/src/dbfunctions.h +++ b/src/src/dbfunctions.h @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/dbfunctions.h,v 1.2 2005/01/04 10:00:42 ph10 Exp $ */ +/* $Cambridge: exim/src/src/dbfunctions.h,v 1.3 2005/06/14 10:32:01 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -21,10 +21,15 @@ int dbfn_write(open_db *, uschar *, void *, int); #define dbfn_read(a, b) dbfn_read_with_length(a, b, NULL) -/* Berkeley DB uses a callback function to pass back error details. */ +/* Berkeley DB uses a callback function to pass back error details. Its API +changed at release 4.3. */ #if defined(USE_DB) && defined(DB_VERSION_STRING) +#if DB_VERSION_MAJOR > 4 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 3) +void dbfn_bdb_error_callback(const DB_ENV *, const char *, const char *); +#else void dbfn_bdb_error_callback(const char *, char *); #endif +#endif /* End of dbfunctions.h */ diff --git a/src/src/exim_dbmbuild.c b/src/src/exim_dbmbuild.c index 1c06b710a..2d4bc3b6a 100644 --- a/src/src/exim_dbmbuild.c +++ b/src/src/exim_dbmbuild.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/exim_dbmbuild.c,v 1.2 2005/01/04 10:00:42 ph10 Exp $ */ +/* $Cambridge: exim/src/src/exim_dbmbuild.c,v 1.3 2005/06/14 10:32:01 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -58,12 +58,18 @@ return sys_errlist[n]; /* For Berkeley DB >= 2, we can define a function to be called in case of DB errors. This should help with debugging strange DB problems, e.g. getting "File -exists" when you try to open a db file. */ +exists" when you try to open a db file. The API changed at release 4.3. */ #if defined(USE_DB) && defined(DB_VERSION_STRING) void +#if DB_VERSION_MAJOR > 4 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 3) +dbfn_bdb_error_callback(const DB_ENV *dbenv, const char *pfx, const char *msg) +{ +dbenv = dbenv; +#else dbfn_bdb_error_callback(const char *pfx, char *msg) { +#endif pfx = pfx; printf("Berkeley DB error: %s\n", msg); } diff --git a/src/src/exim_dbutil.c b/src/src/exim_dbutil.c index a8dbe61b8..03c00a411 100644 --- a/src/src/exim_dbutil.c +++ b/src/src/exim_dbutil.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/exim_dbutil.c,v 1.4 2005/05/23 16:58:56 fanf2 Exp $ */ +/* $Cambridge: exim/src/src/exim_dbutil.c,v 1.5 2005/06/14 10:32:01 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -78,12 +78,18 @@ not too much extra baggage. */ /* For Berkeley DB >= 2, we can define a function to be called in case of DB errors. This should help with debugging strange DB problems, e.g. getting "File -exists" when you try to open a db file. */ +exists" when you try to open a db file. The API changed at release 4.3. */ #if defined(USE_DB) && defined(DB_VERSION_STRING) void +#if DB_VERSION_MAJOR > 4 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 3) +dbfn_bdb_error_callback(const DB_ENV *dbenv, const char *pfx, const char *msg) +{ +dbenv = dbenv; +#else dbfn_bdb_error_callback(const char *pfx, char *msg) { +#endif pfx = pfx; printf("Berkeley DB error: %s\n", msg); } -- cgit v1.2.3