u_int32_t flags = 0;
int dbversion_major, dbversion_minor, dbversion_patch;
- fprintf(stderr,
- "ctdldump: open_dbenv() starting\n"
- "ctdldump: Linked zlib: %s\n"
- "ctdldump: Compiled libdb: %s\n"
- "ctdldump: Linked libdb: %s\n",
- zlibVersion(),
- DB_VERSION_STRING,
- db_version(&dbversion_major, &dbversion_minor, &dbversion_patch)
- );
+ db_version(&dbversion_major, &dbversion_minor, &dbversion_patch);
// Create synthetic integer version numbers and compare them.
- // Never run with a libdb older than the one with which it was compiled.
+ // Never run with a libdb other than the one with which it was compiled.
int compiled_db_version = ( (DB_VERSION_MAJOR * 1000000) + (DB_VERSION_MINOR * 1000) + (DB_VERSION_PATCH) );
int linked_db_version = ( (dbversion_major * 1000000) + (dbversion_minor * 1000) + (dbversion_patch) );
- if (compiled_db_version > linked_db_version) {
- fprintf(stderr, "ctdldump: ctdldump is running with a version of libdb older than the one with which it was compiled.\n"
+ if (compiled_db_version != linked_db_version) {
+ fprintf(stderr, "ctdldump: ctdldump is running with a version of libdb other than the one with which it was compiled.\n"
"ctdldump: This is an invalid configuration. ctdldump will now exit to prevent data loss.");
exit(CTDLEXIT_DB);
}
- fprintf(stderr, "ctdldump: Setting up DB environment\n");
ret = db_env_create(&dbenv, 0);
if (ret) {
fprintf(stderr, "ctdldump: db_env_create: %s\n", db_strerror(ret));
}
flags = DB_CREATE | DB_INIT_MPOOL | DB_PRIVATE | DB_INIT_LOG;
- fprintf(stderr, "ctdldump: dbenv open(dir=%s, flags=%d)\n", dirname, flags);
ret = dbenv->open(dbenv, dirname, flags, 0);
if (ret) {
fprintf(stderr, "ctdldump: dbenv->open: %s\n", db_strerror(ret));
fprintf(stderr, "ctdldump: You have specified the [-y] flag, so processing will continue.\n");
}
else {
- fprintf(stderr, "ctdldump: Please read [ https://www.citadel.org/ctdldump.html ] to learn how to proceed.\n");
+ fprintf(stderr, "ctdldump: Please read [ https://www.citadel.org/dump-and-load.html ] to learn how to proceed.\n");
exit(0);
}