Description: libdb4 compatibility adjustments.
Author: Jan Christoph Nordholz <hesso@pool.math.tu-berlin.de>
Last-Update: 2009-03-01
Index: nvi-1.81.6/common/msg.c
===================================================================
--- nvi-1.81.6.orig/common/msg.c
+++ nvi-1.81.6/common/msg.c
@@ -724,9 +724,18 @@ msg_open(SCR *sp, char *file)
 		p = buf;
 	} else
 		p = file;
+	if (access(p, F_OK) != 0) {
+		if (first) {
+			first = 0;
+			return (1);
+		}
+		sp->db_error = ENOENT;
+		msgq_str(sp, M_DBERR, p, "%s");
+		return (1);
+	}
 	if ((sp->db_error = db_create(&db, 0, 0)) != 0 ||
 	    (sp->db_error = db->set_re_source(db, p)) != 0 ||
-	    (sp->db_error = db_open(db, NULL, DB_RECNO, 0, 0)) != 0) {
+	    (sp->db_error = db_open(db, NULL, DB_RECNO, DB_CREATE, 0)) != 0) {
 		if (first) {
 			first = 0;
 			return (1);
