--- nvi-1.81.5/dist/configure.in +++ nvi-1.81.5/dist/configure.in @@ -922,11 +922,14 @@ CFLAGS="-I$with_db3/include $CFLAGS" fi; +saveLIBS="$LIBS" +LIBS="$LIBS -ldb" -AC_CHECK_LIB(db, db_create, +AC_TRY_LINK([#include ], [db_create(0, 0, 0)], [vi_cv_dbfatal="no"], [vi_cv_dbfatal="yes"]) if test "$vi_cv_dbfatal" = "yes"; then - AC_MSG_ERROR([Need DB 3.]) + AC_MSG_ERROR([Need DB 4.]) fi +LIBS="$saveLIBS" LDFLAGS="$saveLDFLAGS" --- nvi-1.81.5/dist/configure +++ nvi-1.81.5/dist/configure @@ -10679,56 +10679,36 @@ CFLAGS="-I$with_db3/include $CFLAGS" fi; -echo $ac_n "checking for db_create in -ldb""... $ac_c" 1>&6 -echo "configure:10684: checking for db_create in -ldb" >&5 -ac_lib_var=`echo db'_'db_create | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-ldb $LIBS" +saveLIBS="$LIBS" +LIBS="$LIBS -ldb" cat > conftest.$ac_ext < int main() { -db_create() +db_create(0, 0, 0) ; return 0; } EOF -if { (eval echo configure:10703: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10693: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" + vi_cv_dbfatal="no" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" + vi_cv_dbfatal="yes" fi rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - vi_cv_dbfatal="no" -else - echo "$ac_t""no" 1>&6 -vi_cv_dbfatal="yes" -fi - if test "$vi_cv_dbfatal" = "yes"; then - { echo "configure: error: Need DB 3." 1>&2; exit 1; } + { echo "configure: error: Need DB 4." 1>&2; exit 1; } fi +LIBS="$saveLIBS" LDFLAGS="$saveLDFLAGS" echo $ac_n "checking if --enable-dynamic-loading option specified""... $ac_c" 1>&6 -echo "configure:10732: checking if --enable-dynamic-loading option specified" >&5 +echo "configure:10712: checking if --enable-dynamic-loading option specified" >&5 # Check whether --enable-dynamic-loading or --disable-dynamic-loading was given. if test "${enable_dynamic_loading+set}" = set; then enableval="$enable_dynamic_loading" @@ -10740,7 +10720,7 @@ echo "$ac_t""$vi_cv_dl" 1>&6 if test "$vi_cv_dl" = yes; then echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:10744: checking for dlopen in -ldl" >&5 +echo "configure:10724: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -10748,7 +10728,7 @@ ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10743: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -10789,7 +10769,7 @@ # Extract the first word of "libdb-3.so", so it can be a program name with args. set dummy libdb-3.so; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:10793: checking for $ac_word" >&5 +echo "configure:10773: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_vi_cv_path_db3'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -10843,7 +10823,7 @@ echo $ac_n "checking if --disable-re option specified""... $ac_c" 1>&6 -echo "configure:10847: checking if --disable-re option specified" >&5 +echo "configure:10827: checking if --disable-re option specified" >&5 # Check whether --enable-re or --disable-re was given. if test "${enable_re+set}" = set; then enableval="$enable_re" --- nvi-1.81.5/common/db.c +++ nvi-1.81.5/common/db.c @@ -175,7 +175,7 @@ data.ulen = ep->c_blen; data.flags = DB_DBT_USERMEM; switch (ep->db->get(ep->db, NULL, &key, &data, 0)) { - case ENOMEM: + case DB_BUFFER_SMALL: nlen = data.size; goto retry; default: --- nvi-1.81.5/common/db.h +++ nvi-1.81.5/common/db.h @@ -1,5 +1,9 @@ #include +#ifndef DB_BUFFER_SMALL +#define DB_BUFFER_SMALL ENOMEM +#endif + #ifdef USE_DYNAMIC_LOADING #define db_create nvi_db_create #define db_env_create nvi_db_env_create --- nvi-1.81.5/common/exf.c +++ nvi-1.81.5/common/exf.c @@ -282,7 +282,7 @@ #define NOMMAPIFFCNTL 0 #endif - if ((sp->db_error = ep->db->open(ep->db, ep->rcv_path, NULL, DB_RECNO, + if ((sp->db_error = ep->db->open(ep->db, NULL, ep->rcv_path, NULL, DB_RECNO, ((rcv_name == 0) ? DB_TRUNCATE : 0) | VI_DB_THREAD | NOMMAPIFFCNTL, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)) != 0) { msgq_str(sp, --- nvi-1.81.5/common/log.c +++ nvi-1.81.5/common/log.c @@ -108,7 +108,7 @@ ep->l_high = ep->l_cur = 1; if (db_create(&ep->log, sp->gp->env, 0) != 0 || - ep->log->open(ep->log, NULL, NULL, DB_RECNO, + ep->log->open(ep->log, NULL, NULL, NULL, DB_RECNO, DB_CREATE | VI_DB_THREAD, S_IRUSR | S_IWUSR) != 0) { msgq(sp, M_SYSERR, "009|Log file"); F_SET(ep, F_NOLOG); --- nvi-1.81.5/common/msg.c +++ nvi-1.81.5/common/msg.c @@ -721,7 +721,7 @@ p = file; if ((sp->db_error = db_create(&db, sp->gp->env, 0)) != 0 || (sp->db_error = db->set_re_source(db, p)) != 0 || - (sp->db_error = db->open(db, NULL, NULL, DB_RECNO, 0, 0)) != 0) { + (sp->db_error = db->open(db, NULL, NULL, NULL, DB_RECNO, 0, 0)) != 0) { if (first) { first = 0; return (1);