Author: rmeggins
Update of /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv3673/ldapserver/ldap/servers/slapd/back-ldbm
Modified Files: dbhelp.c dblayer.c dblayer.h 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: dbhelp.c =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/dbhelp.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- dbhelp.c 10 Nov 2006 23:45:39 -0000 1.6 +++ dbhelp.c 15 Nov 2006 17:47:58 -0000 1.7 @@ -225,7 +225,11 @@ { pEnv->set_errpfx(pEnv, "ns-slapd"); if (priv->dblayer_verbose) { +#if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR >= 4300 + /* DB_VERB_CHKPOINT removed in 43 */ +#else pEnv->set_verbose(pEnv, DB_VERB_CHKPOINT, 1); /* 1 means on */ +#endif pEnv->set_verbose(pEnv, DB_VERB_DEADLOCK, 1); /* 1 means on */ pEnv->set_verbose(pEnv, DB_VERB_RECOVERY, 1); /* 1 means on */ pEnv->set_verbose(pEnv, DB_VERB_WAITSFOR, 1); /* 1 means on */
Index: dblayer.c =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/dblayer.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- dblayer.c 10 Nov 2006 23:45:39 -0000 1.14 +++ dblayer.c 15 Nov 2006 17:47:58 -0000 1.15 @@ -325,7 +325,12 @@ }
/* Callback function for libdb to spit error info into our log */ +#if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR >= 4300 +void dblayer_log_print(const DB_ENV *dbenv, const char* prefix, + const char *buffer) +#else void dblayer_log_print(const char* prefix, char *buffer) +#endif { /* We ignore the prefix since we know who we are anyway */ LDAPDebug(LDAP_DEBUG_ANY,"libdb: %s\n", buffer, 0, 0); @@ -400,6 +405,16 @@ return (ret < 0) ? errno : 0; }
+/* Helper function for large seeks, db4.3 */ +static int dblayer_seek43_large(int fd, off64_t offset, int whence) +{ + int ret = 0; + + ret = lseek64(fd, offset, whence); + + return (ret < 0) ? errno : 0; +} + /* helper function for large fstat -- this depends on 'struct stat64' having * the following members: * off64_t st_size; @@ -464,7 +479,11 @@ #endif /* !irix */ db_env_set_func_ioinfo(dblayer_ioinfo_large); db_env_set_func_exists((int (*)())dblayer_exists_large); +#if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR >= 4300 + db_env_set_func_seek((int (*)())dblayer_seek43_large); +#else db_env_set_func_seek((int (*)())dblayer_seek24_large); +#endif
LDAPDebug(LDAP_DEBUG_TRACE, "Enabled 64-bit files\n", 0, 0, 0); #endif /* DB_USE_64LFS */
Index: dblayer.h =================================================================== RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/dblayer.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- dblayer.h 10 Nov 2006 23:45:39 -0000 1.6 +++ dblayer.h 15 Nov 2006 17:47:58 -0000 1.7 @@ -170,7 +170,12 @@ int dblayer_lock_config; };
+#if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR >= 4300 +void dblayer_log_print(const DB_ENV *dbenv, const char* prefix, + const char *buffer); +#else void dblayer_log_print(const char* prefix, char *buffer); +#endif
int dblayer_db_remove(dblayer_private_env * env, char const path[], char const dbName[]);
389-commits@lists.fedoraproject.org