summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2007-05-09 20:42:52 +0000
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2007-05-09 20:42:52 +0000
commitfd502754926131e3562a2210ff81af111ccaf867 (patch)
treeff62efd1b045adec527bce51a0aa939a0eca020e /src
parentc72478ce90d83e355ad7782991d20cbbd2664fd3 (diff)
downloadlibrcc-fd502754926131e3562a2210ff81af111ccaf867.tar.gz
librcc-fd502754926131e3562a2210ff81af111ccaf867.tar.bz2
librcc-fd502754926131e3562a2210ff81af111ccaf867.tar.xz
librcc-fd502754926131e3562a2210ff81af111ccaf867.zip
VERSION 0.2.4: Ultimate fixes
- Autoconf: check if ssize_t size_t types are missing in sys/types.h - Autoconf: really check for iconv.h residing in /usr/local - Support for older versions of BerkleyDB (fallback to original approach)
Diffstat (limited to 'src')
-rw-r--r--src/rccdb4.c14
-rw-r--r--src/rccexternal.h2
2 files changed, 11 insertions, 5 deletions
diff --git a/src/rccdb4.c b/src/rccdb4.c
index 1eb5d44..d21f36b 100644
--- a/src/rccdb4.c
+++ b/src/rccdb4.c
@@ -17,14 +17,16 @@ db4_context rccDb4CreateContext(const char *dbpath, rcc_db4_flags flags) {
DB_ENV *dbe;
DB *db;
-# if 0
+# ifndef DB_LOG_AUTOREMOVE
+# ifdef DB_VERSION_MISMATCH
char stmp[160];
-# endif
+# endif /* DB_VERSION_MISMATCH */
+# endif /* DB_LOG_AUTOREMOVE */
err = db_env_create(&dbe, 0);
if (err) return NULL;
-# if 1
+# ifdef DB_LOG_AUTOREMOVE
dbe->set_flags(dbe, DB_LOG_AUTOREMOVE, 1);
dbe->set_lg_max(dbe, 131072);
@@ -33,8 +35,9 @@ db4_context rccDb4CreateContext(const char *dbpath, rcc_db4_flags flags) {
err = dbe->open(dbe, dbpath, DB_CREATE|DB_INIT_TXN|DB_USE_ENVIRON|DB_INIT_LOCK|DB_INIT_MPOOL|DB_RECOVER, 00644);
rccUnLock();
}
-# else
+# else /* DB_LOG_AUTOREMOVE */
err = dbe->open(dbe, dbpath, DB_CREATE|DB_INIT_CDB|DB_INIT_MPOOL, 00644);
+# ifdef DB_VERSION_MISMATCH
if (err == DB_VERSION_MISMATCH) {
if (!rccLock()) {
err = dbe->open(dbe, dbpath, DB_CREATE|DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_USE_ENVIRON|DB_PRIVATE|DB_RECOVER, 0);
@@ -59,7 +62,8 @@ db4_context rccDb4CreateContext(const char *dbpath, rcc_db4_flags flags) {
err = dbe->open(dbe, dbpath, DB_CREATE|DB_INIT_CDB|DB_INIT_MPOOL, 00644);
}
-# endif
+# endif /* DB_VERSION_MISMATCH */
+# endif /* DB_LOG_AUTOREMOVE */
if (err) {
// fprintf(stderr, "BerkelyDB initialization failed: %i (%s)\n", err, db_strerror(err));
diff --git a/src/rccexternal.h b/src/rccexternal.h
index 1038329..181a6ec 100644
--- a/src/rccexternal.h
+++ b/src/rccexternal.h
@@ -1,6 +1,8 @@
#ifndef _RCC_EXTERNAL_H
#define _RCC_EXTERNAL_H
+#include "../config.h"
+
typedef enum rcc_external_module_t {
RCC_EXTERNAL_MODULE_CONTROL = 0,
RCC_EXTERNAL_MODULE_OPTIONS,