}
-// Open the various tables we'll be using. Any table which
-// does not exist should be created. Note that we don't need a
-// critical section here, because there aren't any active threads
-// manipulating the database yet.
+// Open the various tables we'll be using. Any table which does not exist should be created. Note that we don't need a
+// critical section here, because there aren't any active threads manipulating the database yet.
void bdb_open_databases(void) {
int ret;
int i;
destLen = (uLongf) zheader.uncompressed_len;
uncompressed_data = malloc(zheader.uncompressed_len);
- if (uncompress((Bytef *) uncompressed_data,
- (uLongf *) &destLen, (const Bytef *) compressed_data, (uLong) sourceLen) != Z_OK) {
+ if (uncompress((Bytef *) uncompressed_data, (uLongf *) &destLen, (const Bytef *) compressed_data, (uLong) sourceLen) != Z_OK) {
syslog(LOG_ERR, "bdb: uncompress() error");
bdb_abort();
}
}
}
+
// Calling this function activates the Berkeley DB back end.
void bdb_init_backend(void) {
cdb_tick = bdb_tick;
// Some functions in this backend need to store some per-thread data.
- // We crerate the key here, during module initialization.
+ // We create the key here, during module initialization.
if (pthread_key_create(&bdb_thread_key, NULL) != 0) {
syslog(LOG_ERR, "pthread_key_create() : %m");
exit(CTDLEXIT_THREAD);