+
+ cdb_chmod_data(); // Set file level permissions so we can actually access the data files
+
+ // Test for Berkeley DB (this does nothing yet -- we're preparing to test for multiple back ends in the future)
+ int fd = open(ctdl_db_dir"/cdb.00", O_RDONLY);
+ if (fd) {
+ char junk[12];
+ uint32_t magic;
+ read(fd, junk, 12); // throw the first 12 bytes away
+ read(fd, &magic, sizeof(magic));
+ if (magic == 0x00053162) {
+ syslog(LOG_DEBUG, "db: found existing Citadel database in Berkeley DB format");
+ }
+ close(fd);
+ }
+