diff options
author | miwi <miwi@FreeBSD.org> | 2011-11-17 00:15:48 +0800 |
---|---|---|
committer | miwi <miwi@FreeBSD.org> | 2011-11-17 00:15:48 +0800 |
commit | 9b6df54cf9ec656a0d654961cd76f99e8191ec2b (patch) | |
tree | 5b64fdbd668c0accc7e05ba2c06df9d6b4ee84c2 /www/squidguard | |
parent | 67046f15cab89f773a3d038b07b237216e794ad9 (diff) | |
download | freebsd-ports-gnome-9b6df54cf9ec656a0d654961cd76f99e8191ec2b.tar.gz freebsd-ports-gnome-9b6df54cf9ec656a0d654961cd76f99e8191ec2b.tar.zst freebsd-ports-gnome-9b6df54cf9ec656a0d654961cd76f99e8191ec2b.zip |
- Fix build with BDB 5.2
PR: 162582
Submitted by: Guido Falsi <mad@madpilot.net> (maintainer)
Feature safe: yes
Diffstat (limited to 'www/squidguard')
-rw-r--r-- | www/squidguard/files/patch-src_sgDB.c | 27 |
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)); } |