summaryrefslogtreecommitdiff
path: root/editors/nvi/patches/patch-aa
blob: c3af045f01e53edf8b823d70493ce7d2c2acf5b1 (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.4 2009/08/07 16:39:20 lukem 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-19 03:41:42.000000000 +1100
+++ ../common/db.h
@@ -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