2013-09-26 17:14:40 +02:00

20 lines
710 B
Plaintext

$NetBSD: patch-aa,v 1.5 2013/01/23 17:26:07 wiz 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