Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Here is a reduced version of the same patch I sent one week ago. It allows = inn 2.3.3 to properly build on a system that has the latest db 4.1.24 installed. My earlier patch introduced a transaction context that was unneccessary. Regards, Michael diff -Naur inn-2.3.3.orig/storage/ovdb/ovdb.c inn-2.3.3/storage/ovdb/ovdb.c --- inn-2.3.3.orig/storage/ovdb/ovdb.c Mon May 6 08:02:07 2002 +++ inn-2.3.3/storage/ovdb/ovdb.c Mon Oct 14 21:37:07 2002 @@ -99,7 +99,7 @@ #error Need BerkeleyDB 2.6.x, 2.7.x, or 3.x #endif #else -#if DB_VERSION_MAJOR !=3D 3 +#if DB_VERSION_MAJOR !=3D 3 && DB_VERSION_MAJOR !=3D 4 #error Need BerkeleyDB 2.6.x, 2.7.x, or 3.x #endif #endif @@ -401,13 +401,23 @@ if(ovdb_conf.pagesize > 0) (dbs[which])->set_pagesize(dbs[which], ovdb_conf.pagesize); =20 +#if (DB_VERSION_MAJOR >=3D 4 && DB_VERSION_MAJOR >=3D 1) +/* starting sometime early db 4.X, db->open gets a new parameter */ + if(ret =3D (dbs[which])->open(dbs[which], 0, _dbnames[which], NULL, + DB_BTREE, _db_flags, 0666)) { + (dbs[which])->close(dbs[which], 0); + dbs[which] =3D NULL; + return ret; + } +#else if(ret =3D (dbs[which])->open(dbs[which], _dbnames[which], NULL, DB_BT= REE, _db_flags, 0666)) { (dbs[which])->close(dbs[which], 0); dbs[which] =3D NULL; return ret; } -#endif +#endif /* #if DB_VERSION_MAJOR >=3D 4 */ +#endif /* #if DB_VERSION_MAJOR =3D=3D 2 */ return 0; } =20 @@ -590,7 +600,7 @@ return TRUE; } =20 -#if DB_VERSION_MAJOR =3D=3D 3 +#if DB_VERSION_MAJOR >=3D 3 static int upgrade_database(char *name) { int ret; @@ -659,7 +669,7 @@ if(flags & OVDB_RECOVER) ai_flags |=3D DB_RECOVER; =20 -#if DB_VERSION_MAJOR =3D=3D 2 || DB_VERSION_MINOR < 2 +#if DB_VERSION_MAJOR =3D=3D 2 || (DB_VERSION_MAJOR =3D=3D 3 && DB_VERSION_= MINOR < 2) if(ovdb_conf.txn_nosync) ai_flags |=3D DB_TXN_NOSYNC; #endif @@ -697,12 +707,12 @@ OVDBenv->set_errcall(OVDBenv, OVDBerror); OVDBenv->set_cachesize(OVDBenv, 0, ovdb_conf.cachesize, 1); =20 -#if DB_VERSION_MINOR >=3D 2 +#if (DB_VERSION_MAJOR =3D=3D 3 && DB_VERSION_MINOR >=3D 2) || DB_VERSION_M= AJOR >=3D 4 if(ovdb_conf.txn_nosync) OVDBenv->set_flags(OVDBenv, DB_TXN_NOSYNC, 1); #endif =20 -#if DB_VERSION_MINOR =3D=3D 0 +#if DB_VERSION_MAJOR =3D=3D 3 && DB_VERSION_MINOR =3D=3D 0 if(ret =3D OVDBenv->open(OVDBenv, ovdb_conf.home, NULL, ai_flags, 0666= )) { #else if(ret =3D OVDBenv->open(OVDBenv, ovdb_conf.home, ai_flags, 0666)) { @@ -726,12 +736,22 @@ syslog(L_FATAL, "OVDB: open: db_create: %s", db_strerror(ret)); return ret; } - if(ret =3D vdb->open(vdb, "version", NULL, DB_BTREE, + +#if (DB_VERSION_MAJOR >=3D 4 && DB_VERSION_MAJOR >=3D 1) +/* starting sometime early db 4.X, db->open gets a new parameter */ + if(ret =3D vdb->open(vdb, 0, "version", NULL, DB_BTREE, _db_flags, 0666)) { vdb->close(vdb, 0); syslog(L_FATAL, "OVDB: open: version->open: %s", db_strerror(ret)); return ret; } +#else + if(ret =3D vdb->open(vdb, "version", NULL, DB_BTREE, _db_flags, 0666))= { + vdb->close(vdb, 0); + syslog(L_FATAL, "OVDB: open: version->open: %s", db_strerror(ret)); + return ret; + } +#endif /* DB_VERSION_MAJOR >=3D 4 */ #endif /* DB_VERSION_MAJOR =3D=3D 2 */ =20 memset(&key, 0, sizeof key); @@ -841,33 +861,62 @@ syslog(L_FATAL, "OVDB: open: db_create: %s", db_strerror(ret)); return FALSE; } + +#if (DB_VERSION_MAJOR >=3D 4 && DB_VERSION_MAJOR >=3D 1) +/* starting sometime early db 4.X, db->open gets a new parameter */ + if(ret =3D groupstats->open(groupstats, 0, "groupstats", NULL, + DB_BTREE, _db_flags, 0666)) { + groupstats->close(groupstats, 0); + syslog(L_FATAL, "OVDB: open: groupstats->open: %s", db_strerror(ret)); + return FALSE; + } +#else if(ret =3D groupstats->open(groupstats, "groupstats", NULL, DB_BTREE, _db_flags, 0666)) { groupstats->close(groupstats, 0); syslog(L_FATAL, "OVDB: open: groupstats->open: %s", db_strerror(ret)); return FALSE; } +#endif /* #if DB_VERSION_MAJOR >=3D 4 */ if(ret =3D db_create(&groupsbyname, OVDBenv, 0)) { syslog(L_FATAL, "OVDB: open: db_create: %s", db_strerror(ret)); return FALSE; } +#if (DB_VERSION_MAJOR >=3D 4 && DB_VERSION_MAJOR >=3D 1) + if(ret =3D groupsbyname->open(groupsbyname, 0, "groupsbyname", NULL, D= B_HASH, + _db_flags, 0666)) { + groupsbyname->close(groupsbyname, 0); + syslog(L_FATAL, "OVDB: open: groupsbyname->open: %s", db_strerror(ret)); + return FALSE; + } +#else if(ret =3D groupsbyname->open(groupsbyname, "groupsbyname", NULL, DB_H= ASH, _db_flags, 0666)) { groupsbyname->close(groupsbyname, 0); syslog(L_FATAL, "OVDB: open: groupsbyname->open: %s", db_strerror(ret)); return FALSE; } +#endif /* #if DB_VERSION_MAJOR >=3D 4 */ if(ret =3D db_create(&groupaliases, OVDBenv, 0)) { syslog(L_FATAL, "OVDB: open: db_create: %s", db_strerror(ret)); return FALSE; } +#if (DB_VERSION_MAJOR >=3D 4 && DB_VERSION_MAJOR >=3D 1) + if(ret =3D groupaliases->open(groupaliases, 0, "groupaliases", NULL, D= B_HASH, + _db_flags, 0666)) { + groupaliases->close(groupaliases, 0); + syslog(L_FATAL, "OVDB: open: groupaliases->open: %s", db_strerror(ret)); + return FALSE; + } +#else if(ret =3D groupaliases->open(groupaliases, "groupaliases", NULL, DB_H= ASH, _db_flags, 0666)) { groupaliases->close(groupaliases, 0); syslog(L_FATAL, "OVDB: open: groupaliases->open: %s", db_strerror(ret)); return FALSE; } -#endif +#endif /* #if DB_VERSION_MAJOR >=3D 4 */ +#endif /* #if DB_VERSION_MAJOR =3D=3D 2 */ =20 Cutofflow =3D FALSE; return TRUE; -- Attached file included as plaintext by Ecartis -- diff -Naur inn-2.3.3.orig/storage/ovdb/ovdb.c inn-2.3.3/storage/ovdb/ovdb.c --- inn-2.3.3.orig/storage/ovdb/ovdb.c Mon May 6 08:02:07 2002 +++ inn-2.3.3/storage/ovdb/ovdb.c Mon Oct 14 21:37:07 2002 @@ -99,7 +99,7 @@ #error Need BerkeleyDB 2.6.x, 2.7.x, or 3.x #endif #else -#if DB_VERSION_MAJOR != 3 +#if DB_VERSION_MAJOR != 3 && DB_VERSION_MAJOR != 4 #error Need BerkeleyDB 2.6.x, 2.7.x, or 3.x #endif #endif @@ -401,13 +401,23 @@ if(ovdb_conf.pagesize > 0) (dbs[which])->set_pagesize(dbs[which], ovdb_conf.pagesize); +#if (DB_VERSION_MAJOR >= 4 && DB_VERSION_MAJOR >= 1) +/* starting sometime early db 4.X, db->open gets a new parameter */ + if(ret = (dbs[which])->open(dbs[which], 0, _dbnames[which], NULL, + DB_BTREE, _db_flags, 0666)) { + (dbs[which])->close(dbs[which], 0); + dbs[which] = NULL; + return ret; + } +#else if(ret = (dbs[which])->open(dbs[which], _dbnames[which], NULL, DB_BTREE, _db_flags, 0666)) { (dbs[which])->close(dbs[which], 0); dbs[which] = NULL; return ret; } -#endif +#endif /* #if DB_VERSION_MAJOR >= 4 */ +#endif /* #if DB_VERSION_MAJOR == 2 */ return 0; } @@ -590,7 +600,7 @@ return TRUE; } -#if DB_VERSION_MAJOR == 3 +#if DB_VERSION_MAJOR >= 3 static int upgrade_database(char *name) { int ret; @@ -659,7 +669,7 @@ if(flags & OVDB_RECOVER) ai_flags |= DB_RECOVER; -#if DB_VERSION_MAJOR == 2 || DB_VERSION_MINOR < 2 +#if DB_VERSION_MAJOR == 2 || (DB_VERSION_MAJOR == 3 && DB_VERSION_MINOR < 2) if(ovdb_conf.txn_nosync) ai_flags |= DB_TXN_NOSYNC; #endif @@ -697,12 +707,12 @@ OVDBenv->set_errcall(OVDBenv, OVDBerror); OVDBenv->set_cachesize(OVDBenv, 0, ovdb_conf.cachesize, 1); -#if DB_VERSION_MINOR >= 2 +#if (DB_VERSION_MAJOR == 3 && DB_VERSION_MINOR >= 2) || DB_VERSION_MAJOR >= 4 if(ovdb_conf.txn_nosync) OVDBenv->set_flags(OVDBenv, DB_TXN_NOSYNC, 1); #endif -#if DB_VERSION_MINOR == 0 +#if DB_VERSION_MAJOR == 3 && DB_VERSION_MINOR == 0 if(ret = OVDBenv->open(OVDBenv, ovdb_conf.home, NULL, ai_flags, 0666)) { #else if(ret = OVDBenv->open(OVDBenv, ovdb_conf.home, ai_flags, 0666)) { @@ -726,12 +736,22 @@ syslog(L_FATAL, "OVDB: open: db_create: %s", db_strerror(ret)); return ret; } - if(ret = vdb->open(vdb, "version", NULL, DB_BTREE, + +#if (DB_VERSION_MAJOR >= 4 && DB_VERSION_MAJOR >= 1) +/* starting sometime early db 4.X, db->open gets a new parameter */ + if(ret = vdb->open(vdb, 0, "version", NULL, DB_BTREE, _db_flags, 0666)) { vdb->close(vdb, 0); syslog(L_FATAL, "OVDB: open: version->open: %s", db_strerror(ret)); return ret; } +#else + if(ret = vdb->open(vdb, "version", NULL, DB_BTREE, _db_flags, 0666)) { + vdb->close(vdb, 0); + syslog(L_FATAL, "OVDB: open: version->open: %s", db_strerror(ret)); + return ret; + } +#endif /* DB_VERSION_MAJOR >= 4 */ #endif /* DB_VERSION_MAJOR == 2 */ memset(&key, 0, sizeof key); @@ -841,33 +861,62 @@ syslog(L_FATAL, "OVDB: open: db_create: %s", db_strerror(ret)); return FALSE; } + +#if (DB_VERSION_MAJOR >= 4 && DB_VERSION_MAJOR >= 1) +/* starting sometime early db 4.X, db->open gets a new parameter */ + if(ret = groupstats->open(groupstats, 0, "groupstats", NULL, + DB_BTREE, _db_flags, 0666)) { + groupstats->close(groupstats, 0); + syslog(L_FATAL, "OVDB: open: groupstats->open: %s", db_strerror(ret)); + return FALSE; + } +#else if(ret = groupstats->open(groupstats, "groupstats", NULL, DB_BTREE, _db_flags, 0666)) { groupstats->close(groupstats, 0); syslog(L_FATAL, "OVDB: open: groupstats->open: %s", db_strerror(ret)); return FALSE; } +#endif /* #if DB_VERSION_MAJOR >= 4 */ if(ret = db_create(&groupsbyname, OVDBenv, 0)) { syslog(L_FATAL, "OVDB: open: db_create: %s", db_strerror(ret)); return FALSE; } +#if (DB_VERSION_MAJOR >= 4 && DB_VERSION_MAJOR >= 1) + if(ret = groupsbyname->open(groupsbyname, 0, "groupsbyname", NULL, DB_HASH, + _db_flags, 0666)) { + groupsbyname->close(groupsbyname, 0); + syslog(L_FATAL, "OVDB: open: groupsbyname->open: %s", db_strerror(ret)); + return FALSE; + } +#else if(ret = groupsbyname->open(groupsbyname, "groupsbyname", NULL, DB_HASH, _db_flags, 0666)) { groupsbyname->close(groupsbyname, 0); syslog(L_FATAL, "OVDB: open: groupsbyname->open: %s", db_strerror(ret)); return FALSE; } +#endif /* #if DB_VERSION_MAJOR >= 4 */ if(ret = db_create(&groupaliases, OVDBenv, 0)) { syslog(L_FATAL, "OVDB: open: db_create: %s", db_strerror(ret)); return FALSE; } +#if (DB_VERSION_MAJOR >= 4 && DB_VERSION_MAJOR >= 1) + if(ret = groupaliases->open(groupaliases, 0, "groupaliases", NULL, DB_HASH, + _db_flags, 0666)) { + groupaliases->close(groupaliases, 0); + syslog(L_FATAL, "OVDB: open: groupaliases->open: %s", db_strerror(ret)); + return FALSE; + } +#else if(ret = groupaliases->open(groupaliases, "groupaliases", NULL, DB_HASH, _db_flags, 0666)) { groupaliases->close(groupaliases, 0); syslog(L_FATAL, "OVDB: open: groupaliases->open: %s", db_strerror(ret)); return FALSE; } -#endif +#endif /* #if DB_VERSION_MAJOR >= 4 */ +#endif /* #if DB_VERSION_MAJOR == 2 */ Cutofflow = FALSE; return TRUE; -- Attached file included as plaintext by Ecartis -- -----BEGIN PGP SIGNATURE----- Version: 2.6.3ia+4K iQEVAgUBPawdM1uYv80UoVTdAQFWpQf/d+zGKDkl8k7Rzhd+xygJK7hIUUfL1AkM Ucjj7P6nNyUIBfIzparz4PQx2U2MwlDdbvH7zUYSUSXfjLLFZSHqTVD0ilRccazw VYxO8ZqJ9i2c5A1dW0x1zSugyOU11kb//hUN8tfFC4wyrmqrAEU/RnRnArEz3YuX yKkBaZWgNEufVkwCiJduUb1GdWrpHvhO/HPp1IpA/EmdW22vs7agnxH7VQkil/S1 1OErmr+oprMxufobfQqSRpHH4K/mXlM7vtIPjrlM+QmhZ7ALVH1SNR39WN71fTMt k8MHGXnqsTzYV0Ko1FKthdtXogYhkRcsB+xqVCofb1n40i9RYuQPtA== =GK31 -----END PGP SIGNATURE-----