aboutsummaryrefslogtreecommitdiff
path: root/www/squidguard
diff options
context:
space:
mode:
authorMartin Wilke <miwi@FreeBSD.org>2011-11-16 16:15:48 +0000
committerMartin Wilke <miwi@FreeBSD.org>2011-11-16 16:15:48 +0000
commit930def57e5222ee32efdaf8dabdbaaad1a334d2b (patch)
tree4f6a4e7773bc166245395a0441eba76b1ae52fdc /www/squidguard
parent25992fcf9159a471b25e735f9e0f9b89bca4b636 (diff)
downloadports-930def57e5222ee32efdaf8dabdbaaad1a334d2b.tar.gz
ports-930def57e5222ee32efdaf8dabdbaaad1a334d2b.zip
- Fix build with BDB 5.2
PR: 162582 Submitted by: Guido Falsi <mad@madpilot.net> (maintainer) Feature safe: yes
Notes
Notes: svn path=/head/; revision=285918
Diffstat (limited to 'www/squidguard')
-rw-r--r--www/squidguard/files/patch-src_sgDB.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/www/squidguard/files/patch-src_sgDB.c b/www/squidguard/files/patch-src_sgDB.c
index d1e88ef8394c..06a357585359 100644
--- a/www/squidguard/files/patch-src_sgDB.c
+++ b/www/squidguard/files/patch-src_sgDB.c
@@ -1,6 +1,6 @@
--- src/sgDb.c.orig 2008-07-14 20:29:41.000000000 +0200
-+++ src/sgDb.c 2011-05-26 11:04:22.106201692 +0200
-@@ -119,14 +119,20 @@
++++ src/sgDb.c 2011-11-15 12:00:23.744601663 +0100
+@@ -119,14 +119,39 @@
flag = DB_CREATE;
if(createdb)
flag = flag | DB_TRUNCATE;
@@ -11,6 +11,27 @@
+ NULL,
+#endif
+ dbfile, NULL, DB_BTREE, flag, 0664)) != 0) {
++ (void) Db->dbp->close(Db->dbp, 0);
++ sgLogFatalError("Error db_open: %s", strerror(ret));
++ }
++ } else {
++ if ((ret = Db->dbp->open(Db->dbp,
++#if DB_VERSION_MINOR >= 1
++ NULL,
++#endif
++ dbfile, NULL, DB_BTREE, DB_CREATE, 0664)) != 0) {
++ sgLogFatalError("Error db_open: %s", strerror(ret));
++ }
++ }
++#endif
++#if DB_VERSION_MAJOR == 5
++ if(globalUpdate || createdb || (dbfile != NULL && stat(dbfile,&st))){
++ flag = DB_CREATE;
++ if(createdb)
++ flag = flag | DB_TRUNCATE;
++ if ((ret = Db->dbp->open(Db->dbp,
++ NULL,
++ dbfile, NULL, DB_BTREE, flag, 0664)) != 0) {
(void) Db->dbp->close(Db->dbp, 0);
sgLogFatalError("Error db_open: %s", strerror(ret));
}
@@ -18,9 +39,7 @@
- if ((ret =
- Db->dbp->open(Db->dbp, NULL, dbfile, NULL, DB_BTREE, DB_CREATE, 0664)) != 0) {
+ if ((ret = Db->dbp->open(Db->dbp,
-+#if DB_VERSION_MINOR >= 1
+ NULL,
-+#endif
+ dbfile, NULL, DB_BTREE, DB_CREATE, 0664)) != 0) {
sgLogFatalError("Error db_open: %s", strerror(ret));
}