ldap/servers/plugins/replication/cl5_api.c | 2 ++
ldap/servers/slapd/back-ldbm/dblayer.c | 6 ++++++
2 files changed, 8 insertions(+)
New commits:
commit 901dc5e9539ba47eeced5bf68bb9ff59d0b5f02b
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Mon Feb 10 16:49:42 2014 -0500
Ticket 47615 - Failed to compile the DS 389 1.3.2.3 version against Berkeley DB 4.2
version
Bug Description: libdb 4.2 does not support the db->compact feature, which causes
build failures. The compact feature was only added to libdb 4.4
Fix Description: Use preprocessor commands to ioslate the compact code.
https://fedorahosted.org/389/ticket/47615
Reviewed by: rmeggins(Thanks!)
(cherry picked from commit 80e39bce5c2d3649694bfce04822868c7256e022)
diff --git a/ldap/servers/plugins/replication/cl5_api.c
b/ldap/servers/plugins/replication/cl5_api.c
index 980296e..85727f9 100644
--- a/ldap/servers/plugins/replication/cl5_api.c
+++ b/ldap/servers/plugins/replication/cl5_api.c
@@ -3517,6 +3517,7 @@ static void _cl5DoTrimming (ReplicaId rid)
static void
_cl5CompactDBs()
{
+#if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR >= 4400
int rc;
Object *fileObj = NULL;
CL5DBFile *dbFile = NULL;
@@ -3573,6 +3574,7 @@ bail:
}
PR_Unlock (s_cl5Desc.dbTrim.lock);
+#endif
return;
}
diff --git a/ldap/servers/slapd/back-ldbm/dblayer.c
b/ldap/servers/slapd/back-ldbm/dblayer.c
index 3b4a536..6582c7a 100644
--- a/ldap/servers/slapd/back-ldbm/dblayer.c
+++ b/ldap/servers/slapd/back-ldbm/dblayer.c
@@ -4668,7 +4668,9 @@ static int checkpoint_threadmain(void *param)
char **list = NULL;
char **listp = NULL;
struct dblayer_private_env *penv = NULL;
+#if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR >= 4400
time_t time_of_last_comapctdb_completion = current_time(); /* seconds since epoch
*/
+#endif
int compactdb_interval = 0;
back_txn txn;
@@ -4779,6 +4781,8 @@ static int checkpoint_threadmain(void *param)
}
/* find out which log files don't contain active txns */
DB_CHECKPOINT_LOCK(PR_TRUE, penv->dblayer_env_lock);
+
+#if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR >= 4400
/* Compacting DB borrowing the timing of the log flush */
if ((compactdb_interval > 0) &&
(current_time() - time_of_last_comapctdb_completion > compactdb_interval))
{
@@ -4822,6 +4826,8 @@ static int checkpoint_threadmain(void *param)
time_of_last_comapctdb_completion = current_time(); /* seconds since epoch
*/
compactdb_interval = priv->dblayer_compactdb_interval;
}
+#endif
+
rval = LOG_ARCHIVE(penv->dblayer_DB_ENV, &list,
DB_ARCH_ABS, (void *)slapi_ch_malloc);
DB_CHECKPOINT_UNLOCK(PR_TRUE, penv->dblayer_env_lock);