Author: rmeggins
Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/replication In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv3673/ldapserver/ldap/servers/plugins/replication
Modified Files: cl5_api.c Log Message: Resolves: bug 214851 Bug Description: integrating db43 into ds70 Reviewed by: nkinder (Thanks!) Fix Description: I took the original diffs posted by Ulf and merged them in with our code which has changed slightly since the diffs were originally generated. I also put #if directives like the following: #if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR >= 4300 ... db43 features ... #else ... db42 features ... #endif so that we can use both db42 and db43. Platforms tested: RHEL4/FC5 Flag Day: no Doc impact: no
Index: cl5_api.c =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/cl5_api.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- cl5_api.c 10 Nov 2006 23:45:17 -0000 1.11 +++ cl5_api.c 15 Nov 2006 17:47:58 -0000 1.12 @@ -364,7 +364,11 @@ static int _cl5GetRUV2Purge2 (Object *fileObj, RUV **ruv);
/* db error processing */ +#if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR >= 4300 +static void _cl5DBLogPrint(const DB_ENV *dbenv, const char* prefix, const char *buffer); +#else /* assume 42 */ static void _cl5DBLogPrint(const char* prefix, char *buffer); +#endif
/* bakup/recovery, import/export */ static PRBool _cl5IsLogFile (const char *name); @@ -384,7 +388,12 @@ static int _cl5FileEndsWith(const char *filename, const char *ext);
/* Callback function for libdb to spit error info into our log */ +#if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR >= 4300 +static void dblayer_log_print(const DB_ENV *dbenv, const char* prefix, + const char *buffer) +#else static void dblayer_log_print(const char* prefix, char *buffer) +#endif { /* We ignore the prefix since we know who we are anyway */ slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "libdb: %s\n", buffer); @@ -3796,7 +3805,11 @@ if (s_cl5Desc.dbConfig.verbose) { int on = 1; +#if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR >= 4300 + /* DB_VERB_CHKPOINT removed in 43 */ +#else dbEnv->set_verbose(dbEnv, DB_VERB_CHKPOINT, on); +#endif dbEnv->set_verbose(dbEnv, DB_VERB_DEADLOCK, on); dbEnv->set_verbose(dbEnv, DB_VERB_RECOVERY, on); dbEnv->set_verbose(dbEnv, DB_VERB_WAITSFOR, on); @@ -3810,7 +3823,12 @@ #endif }
+#if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR >= 4300 +static void _cl5DBLogPrint(const DB_ENV *dbenv, const char* prefix, + const char *buffer) +#else static void _cl5DBLogPrint(const char* prefix, char *buffer) +#endif { /* We ignore the prefix since we know who we are anyway */ slapi_log_error (SLAPI_LOG_FATAL, repl_plugin_name_cl, "cl5: %s\n", buffer); @@ -4549,7 +4567,10 @@ return CL5_SUCCESS;
case DB_NOTFOUND: file->entryCount = 0; -#if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR >= 3300 + +#if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR >= 4300 + rc = file->db->stat(file->db, NULL, (void*)&stats, 0); +#elif 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR >= 3300 rc = file->db->stat(file->db, (void*)&stats, 0); #else rc = file->db->stat(file->db, (void*)&stats, malloc, 0);
389-commits@lists.fedoraproject.org