]>
Commit | Line | Data |
---|---|---|
e40d3c52 JR |
1 | diff -ur inn-2.3.3/storage/ovdb/ovdb.c inn-2.3.3.db4/storage/ovdb/ovdb.c |
2 | --- inn-2.3.3/storage/ovdb/ovdb.c Mon May 6 08:02:07 2002 | |
3 | +++ inn-2.3.3.db4/storage/ovdb/ovdb.c Fri Nov 8 23:24:50 2002 | |
4 | @@ -99,7 +99,7 @@ | |
5 | #error Need BerkeleyDB 2.6.x, 2.7.x, or 3.x | |
6 | #endif | |
7 | #else | |
8 | -#if DB_VERSION_MAJOR != 3 | |
9 | +#if DB_VERSION_MAJOR != 3 && DB_VERSION_MAJOR != 4 | |
10 | #error Need BerkeleyDB 2.6.x, 2.7.x, or 3.x | |
11 | #endif | |
12 | #endif | |
13 | @@ -401,8 +404,13 @@ | |
14 | if(ovdb_conf.pagesize > 0) | |
15 | (dbs[which])->set_pagesize(dbs[which], ovdb_conf.pagesize); | |
16 | ||
17 | +#if DB_VERSION_MAJOR == 4 | |
18 | + if(ret = (dbs[which])->open(dbs[which], NULL, _dbnames[which], NULL, DB_BTREE, | |
19 | + _db_flags, 0666)) { | |
20 | +#else | |
21 | if(ret = (dbs[which])->open(dbs[which], _dbnames[which], NULL, DB_BTREE, | |
22 | _db_flags, 0666)) { | |
23 | +#endif | |
24 | (dbs[which])->close(dbs[which], 0); | |
25 | dbs[which] = NULL; | |
26 | return ret; | |
27 | @@ -590,7 +598,7 @@ | |
28 | return TRUE; | |
29 | } | |
30 | ||
31 | -#if DB_VERSION_MAJOR == 3 | |
32 | +#if DB_VERSION_MAJOR >= 3 | |
33 | static int upgrade_database(char *name) | |
34 | { | |
35 | int ret; | |
36 | @@ -659,7 +667,7 @@ | |
37 | if(flags & OVDB_RECOVER) | |
38 | ai_flags |= DB_RECOVER; | |
39 | ||
40 | -#if DB_VERSION_MAJOR == 2 || DB_VERSION_MINOR < 2 | |
41 | +#if DB_VERSION_MAJOR == 2 || (DB_VERSION_MAJOR == 3 && DB_VERSION_MINOR < 2) | |
42 | if(ovdb_conf.txn_nosync) | |
43 | ai_flags |= DB_TXN_NOSYNC; | |
44 | #endif | |
45 | @@ -697,12 +705,12 @@ | |
46 | OVDBenv->set_errcall(OVDBenv, OVDBerror); | |
47 | OVDBenv->set_cachesize(OVDBenv, 0, ovdb_conf.cachesize, 1); | |
48 | ||
49 | -#if DB_VERSION_MINOR >= 2 | |
50 | +#if (DB_VERSION_MAJOR == 3 && DB_VERSION_MINOR >= 2) || DB_VERSION_MAJOR == 4 | |
51 | if(ovdb_conf.txn_nosync) | |
52 | OVDBenv->set_flags(OVDBenv, DB_TXN_NOSYNC, 1); | |
53 | #endif | |
54 | ||
55 | -#if DB_VERSION_MINOR == 0 | |
56 | +#if DB_VERSION_MAJOR == 3 && DB_VERSION_MINOR == 0 | |
57 | if(ret = OVDBenv->open(OVDBenv, ovdb_conf.home, NULL, ai_flags, 0666)) { | |
58 | #else | |
59 | if(ret = OVDBenv->open(OVDBenv, ovdb_conf.home, ai_flags, 0666)) { | |
60 | @@ -726,8 +734,13 @@ | |
61 | syslog(L_FATAL, "OVDB: open: db_create: %s", db_strerror(ret)); | |
62 | return ret; | |
63 | } | |
64 | +#if DB_VERSION_MAJOR == 4 | |
65 | + if(ret = vdb->open(vdb, NULL, "version", NULL, DB_BTREE, | |
66 | + _db_flags, 0666)) { | |
67 | +#else | |
68 | if(ret = vdb->open(vdb, "version", NULL, DB_BTREE, | |
69 | _db_flags, 0666)) { | |
70 | +#endif | |
71 | vdb->close(vdb, 0); | |
72 | syslog(L_FATAL, "OVDB: open: version->open: %s", db_strerror(ret)); | |
73 | return ret; | |
74 | @@ -841,8 +854,13 @@ | |
75 | syslog(L_FATAL, "OVDB: open: db_create: %s", db_strerror(ret)); | |
76 | return FALSE; | |
77 | } | |
78 | +#if DB_VERSION_MAJOR == 4 | |
79 | + if(ret = groupstats->open(groupstats, NULL, "groupstats", NULL, DB_BTREE, | |
80 | + _db_flags, 0666)) { | |
81 | +#else | |
82 | if(ret = groupstats->open(groupstats, "groupstats", NULL, DB_BTREE, | |
83 | _db_flags, 0666)) { | |
84 | +#endif | |
85 | groupstats->close(groupstats, 0); | |
86 | syslog(L_FATAL, "OVDB: open: groupstats->open: %s", db_strerror(ret)); | |
87 | return FALSE; | |
88 | @@ -851,8 +869,13 @@ | |
89 | syslog(L_FATAL, "OVDB: open: db_create: %s", db_strerror(ret)); | |
90 | return FALSE; | |
91 | } | |
92 | +#if DB_VERSION_MAJOR == 4 | |
93 | + if(ret = groupsbyname->open(groupsbyname, NULL, "groupsbyname", NULL, DB_HASH, | |
94 | + _db_flags, 0666)) { | |
95 | +#else | |
96 | if(ret = groupsbyname->open(groupsbyname, "groupsbyname", NULL, DB_HASH, | |
97 | _db_flags, 0666)) { | |
98 | +#endif | |
99 | groupsbyname->close(groupsbyname, 0); | |
100 | syslog(L_FATAL, "OVDB: open: groupsbyname->open: %s", db_strerror(ret)); | |
101 | return FALSE; | |
102 | @@ -861,8 +884,13 @@ | |
103 | syslog(L_FATAL, "OVDB: open: db_create: %s", db_strerror(ret)); | |
104 | return FALSE; | |
105 | } | |
106 | +#if DB_VERSION_MAJOR == 4 | |
107 | + if(ret = groupaliases->open(groupaliases, NULL, "groupaliases", NULL, DB_HASH, | |
108 | + _db_flags, 0666)) { | |
109 | +#else | |
110 | if(ret = groupaliases->open(groupaliases, "groupaliases", NULL, DB_HASH, | |
111 | _db_flags, 0666)) { | |
112 | +#endif | |
113 | groupaliases->close(groupaliases, 0); | |
114 | syslog(L_FATAL, "OVDB: open: groupaliases->open: %s", db_strerror(ret)); | |
115 | return FALSE; |