summaryrefslogtreecommitdiff
path: root/editors/nvi/patches/patch-aa
blob: 508be3cbd70a27ad3d3421f0d636bb9ed18aba96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
$NetBSD: patch-aa,v 1.3 2008/12/21 23:02:24 epg Exp $

BDB 4.4 and up requires DB_CREATE or it will spew "DB_CREATE must be
specified to create databases." when nvi edits a file.

--- ../common/db.h.orig	2007-11-18 16:41:42.000000000 +0000
+++ ../common/db.h	2008-12-21 00:18:11.000000000 +0000
@@ -16,7 +16,10 @@
     (env)->remove(env, path, NULL, flags)
 #endif
 
-#if DB_VERSION_MAJOR >= 4 && DB_VERSION_MINOR >= 1
+#if DB_VERSION_MAJOR >= 4 && DB_VERSION_MINOR >= 4
+#define db_open(db,file,type,flags,mode)				\
+    (db)->open(db, NULL, file, NULL, type, flags | DB_CREATE, mode)
+#elif DB_VERSION_MAJOR >= 4 && DB_VERSION_MINOR >= 1
 #define db_open(db,file,type,flags,mode)				\
     (db)->open(db, NULL, file, NULL, type, flags, mode)
 #else