From: Kurt Zeilenga Date: Thu, 14 Jan 1999 02:57:45 +0000 (+0000) Subject: Import slapd changes from devel including: X-Git-Tag: OPENLDAP_REL_ENG_1_1_3~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=30e6b973688bd7c11ea814b1db623504707ca107;p=thirdparty%2Fopenldap.git Import slapd changes from devel including: shutdown without busy loop, explicit yield func no longer mandatory use pthread_detach() to detach threads (instead of creating them in a detached state) pthread_create error reporting moved declarations to init.c Import configure changes: revamp res_search check remove strtok_r check --- diff --git a/configure b/configure index 4f52799d4a..ddf56b6b18 100755 --- a/configure +++ b/configure @@ -4146,18 +4146,17 @@ fi if test $ac_cv_func_sched_yield = no -a \ $ac_cv_func_pthread_yield = no ; then echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2 - { echo "configure: error: POSIX Threads are not usable" 1>&2; exit 1; } fi - for ac_func in pthread_kill + for ac_func in pthread_kill pthread_detach do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4156: checking for $ac_func" >&5 +echo "configure:4155: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:4183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4204,6 +4203,7 @@ else fi done + for ac_func in \ pthread_attr_create pthread_attr_init \ pthread_attr_destroy pthread_attr_delete \ @@ -5154,74 +5154,6 @@ echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6 LIBS="$LTHREAD_LIBS $LIBS" LTHREAD_LIBS="" fi - - save_CPPFLAGS="$CPPFLAGS" - save_LIBS="$LIBS" - LIBS="$LTHREAD_LIBS $LIBS" - for ac_func in \ - strtok_r \ - gmtime_r \ - gethostbyaddr_r gethostbyname_r \ - feof_unlocked unlocked_feof \ - putc_unlocked unlocked_putc \ - flockfile ftrylockfile \ - -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5172: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif - -; return 0; } -EOF -if { (eval echo configure:5200: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 -fi -done - - CPPFLAGS="$save_CPPFLAGS" - LIBS="$save_LIBS" fi @@ -5245,13 +5177,13 @@ fi ol_link_ldbm=no if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then echo $ac_n "checking for DB2 library""... $ac_c" 1>&6 -echo "configure:5249: checking for DB2 library" >&5 +echo "configure:5181: checking for DB2 library" >&5 if eval "test \"`echo '$''{'ol_cv_lib_db2'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ol_LIBS="$LIBS" echo $ac_n "checking for db_open in -ldb""... $ac_c" 1>&6 -echo "configure:5255: checking for db_open in -ldb" >&5 +echo "configure:5187: checking for db_open in -ldb" >&5 ac_lib_var=`echo db'_'db_open | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5259,7 +5191,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldb $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5301,17 +5233,17 @@ for ac_hdr in db.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5305: checking for $ac_hdr" >&5 +echo "configure:5237: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5315: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5247: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -5339,13 +5271,13 @@ done if test $ac_cv_header_db_h = yes ; then echo $ac_n "checking if db.h is DB2""... $ac_c" 1>&6 -echo "configure:5343: checking if db.h is DB2" >&5 +echo "configure:5275: checking if db.h is DB2" >&5 if eval "test \"`echo '$''{'ol_cv_header_db2'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -5377,7 +5309,7 @@ fi echo $ac_n "checking for Berkeley DB2""... $ac_c" 1>&6 -echo "configure:5381: checking for Berkeley DB2" >&5 +echo "configure:5313: checking for Berkeley DB2" >&5 if eval "test \"`echo '$''{'ol_cv_berkeley_db2'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5423,18 +5355,18 @@ fi if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db ; then echo $ac_n "checking for Berkeley DB library""... $ac_c" 1>&6 -echo "configure:5427: checking for Berkeley DB library" >&5 +echo "configure:5359: checking for Berkeley DB library" >&5 if eval "test \"`echo '$''{'ol_cv_lib_db'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ol_LIBS="$LIBS" echo $ac_n "checking for dbopen""... $ac_c" 1>&6 -echo "configure:5433: checking for dbopen" >&5 +echo "configure:5365: checking for dbopen" >&5 if eval "test \"`echo '$''{'ac_cv_func_dbopen'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5393: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_dbopen=yes" else @@ -5476,7 +5408,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6 -echo "configure:5480: checking for dbopen in -ldb" >&5 +echo "configure:5412: checking for dbopen in -ldb" >&5 ac_lib_var=`echo db'_'dbopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5484,7 +5416,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldb $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5431: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5530,17 +5462,17 @@ for ac_hdr in db_185.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5534: checking for $ac_hdr" >&5 +echo "configure:5466: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5544: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5476: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -5576,7 +5508,7 @@ fi echo $ac_n "checking for Berkeley DB""... $ac_c" 1>&6 -echo "configure:5580: checking for Berkeley DB" >&5 +echo "configure:5512: checking for Berkeley DB" >&5 if eval "test \"`echo '$''{'ol_cv_berkeley_db'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5629,17 +5561,17 @@ if test $ol_with_ldbm_api = manual ; then do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5633: checking for $ac_hdr" >&5 +echo "configure:5565: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5643: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5575: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -5674,18 +5606,18 @@ fi if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then echo $ac_n "checking for GDBM library""... $ac_c" 1>&6 -echo "configure:5678: checking for GDBM library" >&5 +echo "configure:5610: checking for GDBM library" >&5 if eval "test \"`echo '$''{'ol_cv_lib_gdbm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ol_LIBS="$LIBS" echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6 -echo "configure:5684: checking for gdbm_open" >&5 +echo "configure:5616: checking for gdbm_open" >&5 if eval "test \"`echo '$''{'ac_cv_func_gdbm_open'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5644: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_gdbm_open=yes" else @@ -5727,7 +5659,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6 -echo "configure:5731: checking for gdbm_open in -lgdbm" >&5 +echo "configure:5663: checking for gdbm_open in -lgdbm" >&5 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5735,7 +5667,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgdbm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5682: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5781,17 +5713,17 @@ echo "$ac_t""$ol_cv_lib_gdbm" 1>&6 do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5785: checking for $ac_hdr" >&5 +echo "configure:5717: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5795: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5727: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -5818,7 +5750,7 @@ fi done echo $ac_n "checking for db""... $ac_c" 1>&6 -echo "configure:5822: checking for db" >&5 +echo "configure:5754: checking for db" >&5 if eval "test \"`echo '$''{'ol_cv_gdbm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5854,18 +5786,18 @@ if test $ol_with_ldbm_api = auto ; then echo "configure: warning: skipping automatic checking for NDBM, must be manually enabled." 1>&2 elif test $ol_with_ldbm_api = ndbm ; then echo $ac_n "checking for NDBM library""... $ac_c" 1>&6 -echo "configure:5858: checking for NDBM library" >&5 +echo "configure:5790: checking for NDBM library" >&5 if eval "test \"`echo '$''{'ol_cv_lib_ndbm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ol_LIBS="$LIBS" echo $ac_n "checking for dbm_open""... $ac_c" 1>&6 -echo "configure:5864: checking for dbm_open" >&5 +echo "configure:5796: checking for dbm_open" >&5 if eval "test \"`echo '$''{'ac_cv_func_dbm_open'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5824: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_dbm_open=yes" else @@ -5907,7 +5839,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6 -echo "configure:5911: checking for dbm_open in -lndbm" >&5 +echo "configure:5843: checking for dbm_open in -lndbm" >&5 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5915,7 +5847,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lndbm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5946,7 +5878,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6 -echo "configure:5950: checking for dbm_open in -ldbm" >&5 +echo "configure:5882: checking for dbm_open in -ldbm" >&5 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5954,7 +5886,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldbm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:5901: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6002,17 +5934,17 @@ echo "$ac_t""$ol_cv_lib_ndbm" 1>&6 do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6006: checking for $ac_hdr" >&5 +echo "configure:5938: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6016: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5948: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -6039,7 +5971,7 @@ fi done echo $ac_n "checking for db""... $ac_c" 1>&6 -echo "configure:6043: checking for db" >&5 +echo "configure:5975: checking for db" >&5 if eval "test \"`echo '$''{'ol_cv_ndbm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6083,7 +6015,7 @@ fi if test $ol_enable_wrappers = yes ; then echo $ac_n "checking for main in -lwrap""... $ac_c" 1>&6 -echo "configure:6087: checking for main in -lwrap" >&5 +echo "configure:6019: checking for main in -lwrap" >&5 ac_lib_var=`echo wrap'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6091,14 +6023,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lwrap $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6034: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6144,17 +6076,17 @@ for ac_hdr in termcap.h ncurses.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6148: checking for $ac_hdr" >&5 +echo "configure:6080: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6158: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6090: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -6183,7 +6115,7 @@ done if test $ol_link_termcap = no ; then echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6 -echo "configure:6187: checking for tputs in -ltermcap" >&5 +echo "configure:6119: checking for tputs in -ltermcap" >&5 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6191,7 +6123,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ltermcap $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6138: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6235,7 +6167,7 @@ fi if test $ol_link_termcap = no ; then echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6 -echo "configure:6239: checking for initscr in -lncurses" >&5 +echo "configure:6171: checking for initscr in -lncurses" >&5 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6243,7 +6175,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lncurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6296,12 +6228,12 @@ fi # FreeBSD (and others) have crypt(3) in -lcrypt if test $ol_enable_crypt != no ; then echo $ac_n "checking for crypt""... $ac_c" 1>&6 -echo "configure:6300: checking for crypt" >&5 +echo "configure:6232: checking for crypt" >&5 if eval "test \"`echo '$''{'ac_cv_func_crypt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6260: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_crypt=yes" else @@ -6343,7 +6275,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6 -echo "configure:6347: checking for crypt in -lcrypt" >&5 +echo "configure:6279: checking for crypt in -lcrypt" >&5 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6351,7 +6283,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcrypt $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6406,12 +6338,12 @@ fi # FreeBSD (and others) have setproctitle(3) in -lutil if test $ol_enable_proctitle != no ; then echo $ac_n "checking for setproctitle""... $ac_c" 1>&6 -echo "configure:6410: checking for setproctitle" >&5 +echo "configure:6342: checking for setproctitle" >&5 if eval "test \"`echo '$''{'ac_cv_func_setproctitle'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_setproctitle=yes" else @@ -6453,7 +6385,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6 -echo "configure:6457: checking for setproctitle in -lutil" >&5 +echo "configure:6389: checking for setproctitle in -lutil" >&5 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6461,7 +6393,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lutil $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6408: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6507,12 +6439,12 @@ EOF fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:6511: checking for ANSI C header files" >&5 +echo "configure:6443: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -6520,7 +6452,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6524: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6456: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -6537,7 +6469,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -6555,7 +6487,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -6576,7 +6508,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -6587,7 +6519,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:6591: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6523: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then : else @@ -6620,12 +6552,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:6624: checking for $ac_hdr that defines DIR" >&5 +echo "configure:6556: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> @@ -6633,7 +6565,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:6637: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6569: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -6658,7 +6590,7 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:6662: checking for opendir in -ldir" >&5 +echo "configure:6594: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6666,7 +6598,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6613: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6699,7 +6631,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:6703: checking for opendir in -lx" >&5 +echo "configure:6635: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -6707,7 +6639,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6654: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -6741,12 +6673,12 @@ fi fi echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:6745: checking for sys/wait.h that is POSIX.1 compatible" >&5 +echo "configure:6677: checking for sys/wait.h that is POSIX.1 compatible" >&5 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -6762,7 +6694,7 @@ wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:6766: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6698: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else @@ -6783,12 +6715,12 @@ EOF fi echo $ac_n "checking POSIX termios""... $ac_c" 1>&6 -echo "configure:6787: checking POSIX termios" >&5 +echo "configure:6719: checking POSIX termios" >&5 if eval "test \"`echo '$''{'am_cv_sys_posix_termios'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -6798,7 +6730,7 @@ int main() { tcgetattr(0, 0); ; return 0; } EOF -if { (eval echo configure:6802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:6734: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* am_cv_sys_posix_termios=yes else @@ -6814,7 +6746,7 @@ echo "$ac_t""$am_cv_sys_posix_termios" 1>&6 echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6 -echo "configure:6818: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5 +echo "configure:6750: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5 if eval "test \"`echo '$''{'am_cv_sys_tiocgwinsz_needs_sys_ioctl_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6823,7 +6755,7 @@ else gwinsz_in_termios_h=no if test $am_cv_sys_posix_termios = yes; then cat > conftest.$ac_ext < # include @@ -6843,7 +6775,7 @@ rm -f conftest* if test $gwinsz_in_termios_h = no; then cat > conftest.$ac_ext < # include @@ -6913,17 +6845,17 @@ for ac_hdr in \ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6917: checking for $ac_hdr" >&5 +echo "configure:6849: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6927: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6859: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -6951,12 +6883,12 @@ done echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:6955: checking for uid_t in sys/types.h" >&5 +echo "configure:6887: checking for uid_t in sys/types.h" >&5 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -6985,7 +6917,7 @@ EOF fi echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6 -echo "configure:6989: checking type of array argument to getgroups" >&5 +echo "configure:6921: checking type of array argument to getgroups" >&5 if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6993,7 +6925,7 @@ else ac_cv_type_getgroups=cross else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6954: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_type_getgroups=gid_t else @@ -7032,7 +6964,7 @@ fi if test $ac_cv_type_getgroups = cross; then cat > conftest.$ac_ext < EOF @@ -7055,12 +6987,12 @@ cat >> confdefs.h <&6 -echo "configure:7059: checking for mode_t" >&5 +echo "configure:6991: checking for mode_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -7088,12 +7020,12 @@ EOF fi echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:7092: checking for off_t" >&5 +echo "configure:7024: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -7121,12 +7053,12 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:7125: checking for pid_t" >&5 +echo "configure:7057: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -7154,19 +7086,19 @@ EOF fi echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6 -echo "configure:7158: checking for ptrdiff_t" >&5 +echo "configure:7090: checking for ptrdiff_t" >&5 if eval "test \"`echo '$''{'am_cv_type_ptrdiff_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { ptrdiff_t p ; return 0; } EOF -if { (eval echo configure:7170: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7102: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* am_cv_type_ptrdiff_t=yes else @@ -7187,12 +7119,12 @@ EOF fi echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:7191: checking return type of signal handlers" >&5 +echo "configure:7123: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -7209,7 +7141,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:7213: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7145: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -7228,12 +7160,12 @@ EOF echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:7232: checking for size_t" >&5 +echo "configure:7164: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -7261,12 +7193,12 @@ EOF fi echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6 -echo "configure:7265: checking for st_blksize in struct stat" >&5 +echo "configure:7197: checking for st_blksize in struct stat" >&5 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -7274,7 +7206,7 @@ int main() { struct stat s; s.st_blksize; ; return 0; } EOF -if { (eval echo configure:7278: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7210: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_blksize=yes else @@ -7295,12 +7227,12 @@ EOF fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:7299: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:7231: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -7309,7 +7241,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:7313: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7245: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -7330,12 +7262,12 @@ EOF fi echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 -echo "configure:7334: checking whether struct tm is in sys/time.h or time.h" >&5 +echo "configure:7266: checking whether struct tm is in sys/time.h or time.h" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -7343,7 +7275,7 @@ int main() { struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:7347: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7279: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -7366,7 +7298,7 @@ fi echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6 -echo "configure:7370: checking if toupper() requires islower()" >&5 +echo "configure:7302: checking if toupper() requires islower()" >&5 if eval "test \"`echo '$''{'ol_cv_c_upper_lower'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7375,7 +7307,7 @@ else ol_cv_c_upper_lower=safe else cat > conftest.$ac_ext < @@ -7387,7 +7319,7 @@ main() exit(1); } EOF -if { (eval echo configure:7391: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7323: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ol_cv_c_upper_lower=no else @@ -7410,12 +7342,12 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:7414: checking for working const" >&5 +echo "configure:7346: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7400: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -7492,14 +7424,14 @@ EOF else echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:7496: checking whether byte ordering is bigendian" >&5 +echo "configure:7428: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include @@ -7510,11 +7442,11 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:7514: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7446: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include @@ -7525,7 +7457,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:7529: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7461: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -7545,7 +7477,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7494: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else @@ -7582,7 +7514,7 @@ EOF fi echo $ac_n "checking size of short""... $ac_c" 1>&6 -echo "configure:7586: checking size of short" >&5 +echo "configure:7518: checking size of short" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7590,7 +7522,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -7601,7 +7533,7 @@ main() exit(0); } EOF -if { (eval echo configure:7605: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_short=`cat conftestval` else @@ -7621,7 +7553,7 @@ EOF echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:7625: checking size of int" >&5 +echo "configure:7557: checking size of int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7629,7 +7561,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -7640,7 +7572,7 @@ main() exit(0); } EOF -if { (eval echo configure:7644: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7576: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int=`cat conftestval` else @@ -7660,7 +7592,7 @@ EOF echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:7664: checking size of long" >&5 +echo "configure:7596: checking size of long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7668,7 +7600,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -7679,7 +7611,7 @@ main() exit(0); } EOF -if { (eval echo configure:7683: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long=`cat conftestval` else @@ -7701,7 +7633,7 @@ EOF fi echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6 -echo "configure:7705: checking for 8-bit clean memcmp" >&5 +echo "configure:7637: checking for 8-bit clean memcmp" >&5 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7709,7 +7641,7 @@ else ac_cv_func_memcmp_clean=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7655: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_memcmp_clean=yes else @@ -7737,12 +7669,12 @@ echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.o" echo $ac_n "checking for strftime""... $ac_c" 1>&6 -echo "configure:7741: checking for strftime" >&5 +echo "configure:7673: checking for strftime" >&5 if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_strftime=yes" else @@ -7787,7 +7719,7 @@ else echo "$ac_t""no" 1>&6 # strftime is in -lintl on SCO UNIX. echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6 -echo "configure:7791: checking for strftime in -lintl" >&5 +echo "configure:7723: checking for strftime in -lintl" >&5 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7795,7 +7727,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7833,12 +7765,12 @@ fi fi echo $ac_n "checking for vprintf""... $ac_c" 1>&6 -echo "configure:7837: checking for vprintf" >&5 +echo "configure:7769: checking for vprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7797: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" else @@ -7885,12 +7817,12 @@ fi if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:7889: checking for _doprnt" >&5 +echo "configure:7821: checking for _doprnt" >&5 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7849: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" else @@ -7942,12 +7874,12 @@ if test $ac_cv_func_vprintf = yes ; then for ac_func in vsnprintf vsprintf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7946: checking for $ac_func" >&5 +echo "configure:7878: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:7906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7997,7 +7929,7 @@ done fi echo $ac_n "checking for wait3 that fills in rusage""... $ac_c" 1>&6 -echo "configure:8001: checking for wait3 that fills in rusage" >&5 +echo "configure:7933: checking for wait3 that fills in rusage" >&5 if eval "test \"`echo '$''{'ac_cv_func_wait3_rusage'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8005,7 +7937,7 @@ else ac_cv_func_wait3_rusage=no else cat > conftest.$ac_ext < #include @@ -8036,7 +7968,7 @@ main() { } } EOF -if { (eval echo configure:8040: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7972: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_wait3_rusage=yes else @@ -8090,12 +8022,12 @@ for ac_func in \ do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:8094: checking for $ac_func" >&5 +echo "configure:8026: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -8146,12 +8078,12 @@ done for ac_func in getopt strdup tempnam do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:8150: checking for $ac_func" >&5 +echo "configure:8082: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8110: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -8204,13 +8136,13 @@ done # Check Configuration echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6 -echo "configure:8208: checking declaration of sys_errlist" >&5 +echo "configure:8140: checking declaration of sys_errlist" >&5 if eval "test \"`echo '$''{'ol_cv_dcl_sys_errlist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -8220,7 +8152,7 @@ int main() { char *c = (char *) *sys_errlist ; return 0; } EOF -if { (eval echo configure:8224: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8156: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ol_cv_dcl_sys_errlist=yes else @@ -8241,20 +8173,20 @@ if test $ol_cv_dcl_sys_errlist = no ; then EOF echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6 -echo "configure:8245: checking existence of sys_errlist" >&5 +echo "configure:8177: checking existence of sys_errlist" >&5 if eval "test \"`echo '$''{'ol_cv_have_sys_errlist'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *c = (char *) *sys_errlist ; return 0; } EOF -if { (eval echo configure:8258: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:8190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ol_cv_have_sys_errlist=yes else diff --git a/configure.in b/configure.in index f15b656679..feb519cc18 100644 --- a/configure.in +++ b/configure.in @@ -582,11 +582,11 @@ if test $ol_with_threads = auto -o $ol_with_threads = yes \ if test $ac_cv_func_sched_yield = no -a \ $ac_cv_func_pthread_yield = no ; then AC_MSG_WARN([could not locate sched_yield() or pthread_yield()]) - AC_MSG_ERROR([POSIX Threads are not usable]) fi dnl Check functions for compatibility - AC_CHECK_FUNCS(pthread_kill) + AC_CHECK_FUNCS(pthread_kill pthread_detach) + AC_CHECK_FUNCS( \ pthread_attr_create pthread_attr_init \ pthread_attr_destroy pthread_attr_delete \ @@ -856,25 +856,6 @@ int x = errno; LIBS="$LTHREAD_LIBS $LIBS" LTHREAD_LIBS="" fi - - dnl check for reentrant/threadsafe functions - dnl - dnl note: these should only be used when linking - dnl with $LTHREAD_LIBS - dnl - save_CPPFLAGS="$CPPFLAGS" - save_LIBS="$LIBS" - LIBS="$LTHREAD_LIBS $LIBS" - AC_CHECK_FUNCS( \ - strtok_r \ - gmtime_r \ - gethostbyaddr_r gethostbyname_r \ - feof_unlocked unlocked_feof \ - putc_unlocked unlocked_putc \ - flockfile ftrylockfile \ - ) - CPPFLAGS="$save_CPPFLAGS" - LIBS="$save_LIBS" fi dnl ---------------------------------------------------------------- diff --git a/include/portable.h.in b/include/portable.h.in index e534b18151..07991cb4f5 100644 --- a/include/portable.h.in +++ b/include/portable.h.in @@ -278,27 +278,12 @@ /* Define if you have the bcopy function. */ #undef HAVE_BCOPY -/* Define if you have the feof_unlocked function. */ -#undef HAVE_FEOF_UNLOCKED - /* Define if you have the flock function. */ #undef HAVE_FLOCK -/* Define if you have the flockfile function. */ -#undef HAVE_FLOCKFILE - -/* Define if you have the ftrylockfile function. */ -#undef HAVE_FTRYLOCKFILE - /* Define if you have the getdtablesize function. */ #undef HAVE_GETDTABLESIZE -/* Define if you have the gethostbyaddr_r function. */ -#undef HAVE_GETHOSTBYADDR_R - -/* Define if you have the gethostbyname_r function. */ -#undef HAVE_GETHOSTBYNAME_R - /* Define if you have the gethostname function. */ #undef HAVE_GETHOSTNAME @@ -311,9 +296,6 @@ /* Define if you have the gettimeofday function. */ #undef HAVE_GETTIMEOFDAY -/* Define if you have the gmtime_r function. */ -#undef HAVE_GMTIME_R - /* Define if you have the lockf function. */ #undef HAVE_LOCKF @@ -344,6 +326,9 @@ /* Define if you have the pthread_attr_setdetachstate function. */ #undef HAVE_PTHREAD_ATTR_SETDETACHSTATE +/* Define if you have the pthread_detach function. */ +#undef HAVE_PTHREAD_DETACH + /* Define if you have the pthread_kill function. */ #undef HAVE_PTHREAD_KILL @@ -353,9 +338,6 @@ /* Define if you have the pthread_yield function. */ #undef HAVE_PTHREAD_YIELD -/* Define if you have the putc_unlocked function. */ -#undef HAVE_PUTC_UNLOCKED - /* Define if you have the res_search function. */ #undef HAVE_RES_SEARCH @@ -404,9 +386,6 @@ /* Define if you have the strtok function. */ #undef HAVE_STRTOK -/* Define if you have the strtok_r function. */ -#undef HAVE_STRTOK_R - /* Define if you have the strtol function. */ #undef HAVE_STRTOL @@ -422,12 +401,6 @@ /* Define if you have the thr_setconcurrency function. */ #undef HAVE_THR_SETCONCURRENCY -/* Define if you have the unlocked_feof function. */ -#undef HAVE_UNLOCKED_FEOF - -/* Define if you have the unlocked_putc function. */ -#undef HAVE_UNLOCKED_PUTC - /* Define if you have the vsnprintf function. */ #undef HAVE_VSNPRINTF diff --git a/libraries/liblthread/thread.c b/libraries/liblthread/thread.c index 6c7cff5415..7421746d79 100644 --- a/libraries/liblthread/thread.c +++ b/libraries/liblthread/thread.c @@ -7,12 +7,11 @@ #if defined( HAVE_PTHREADS ) #ifndef HAVE_PTHREAD_KILL -/*********************************************************************** - * * - * pthreads package with DCE - no mapping to do (except to create a * - * pthread_kill() routine) * - * * - ***********************************************************************/ +/* + * Some pthreads packages (ie: DCE) don't have pthread_kill() + * pthread_kill() routine) + * + */ /* ARGSUSED */ void @@ -22,6 +21,19 @@ pthread_kill( pthread_t tid, int sig ) } #endif /* HAVE_PTHREAD_KILL */ +#if !defined(HAVE_SCHED_YIELD) && !defined(HAVE_PTHREAD_YIELD) +/* + * Some pthreads packages don't have sched_yield() nor + * the draft4 pthread_kill() routine, assume it's not + * needed. + */ +void +pthread_yield( void ) +{ + /* assume pthread implementation is preemptive */ +} +#endif /* missing sched_yield() */ + #elif defined( HAVE_MACH_CTHREADS ) /*********************************************************************** diff --git a/servers/slapd/connection.c b/servers/slapd/connection.c index 98275706a9..0f1f909e38 100644 --- a/servers/slapd/connection.c +++ b/servers/slapd/connection.c @@ -100,6 +100,9 @@ connection_operation( void *arg_v ) pthread_mutex_lock( &active_threads_mutex ); active_threads--; + if( active_threads < 1 ) { + pthread_cond_signal(&active_threads_cond); + } pthread_mutex_unlock( &active_threads_mutex ); return NULL; } @@ -109,7 +112,10 @@ connection_activity( Connection *conn ) { +#ifndef HAVE_PTHREAD_DETACH pthread_attr_t attr; +#endif + int status; struct co_arg *arg; unsigned long tag, len; long msgid; @@ -192,15 +198,33 @@ connection_activity( free( tmpdn ); } +#ifdef HAVE_PTHREAD_DETACH + if ( status = pthread_create( &arg->co_op->o_tid, NULL, + connection_operation, (void *) arg ) != 0 ) { + Debug( LDAP_DEBUG_ANY, "pthread_create failed (%d)\n", status, 0, 0 ); + } else { + pthread_mutex_lock( &active_threads_mutex ); + active_threads++; + pthread_mutex_unlock( &active_threads_mutex ); + } + +#if !defined(HAVE_PTHREADS_D4) + pthread_detach( arg->co_op->o_tid ); +#else + pthread_detach( &arg->co_op->o_tid ); +#endif + +#else /* !pthread detach */ + pthread_attr_init( &attr ); pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_DETACHED ); #if !defined(HAVE_PTHREADS_D4) /* POSIX_THREADS or compatible * This is a draft 10 or standard pthreads implementation */ - if ( pthread_create( &arg->co_op->o_tid, &attr, + if ( status = pthread_create( &arg->co_op->o_tid, &attr, connection_operation, (void *) arg ) != 0 ) { - Debug( LDAP_DEBUG_ANY, "pthread_create failed\n", 0, 0, 0 ); + Debug( LDAP_DEBUG_ANY, "pthread_create failed (%d)\n", status, 0, 0 ); } else { pthread_mutex_lock( &active_threads_mutex ); active_threads++; @@ -210,9 +234,9 @@ connection_activity( /* * This is a draft 4 or earlier pthreads implementation */ - if ( pthread_create( &arg->co_op->o_tid, attr, + if ( status = pthread_create( &arg->co_op->o_tid, attr, connection_operation, (void *) arg ) != 0 ) { - Debug( LDAP_DEBUG_ANY, "pthread_create failed\n", 0, 0, 0 ); + Debug( LDAP_DEBUG_ANY, "pthread_create failed (%d)\n", status, 0, 0 ); } else { pthread_mutex_lock( &active_threads_mutex ); active_threads++; @@ -220,4 +244,5 @@ connection_activity( } #endif /* pthread draft4 */ pthread_attr_destroy( &attr ); +#endif } diff --git a/servers/slapd/daemon.c b/servers/slapd/daemon.c index eded4e8f8c..8cdfb1e52d 100644 --- a/servers/slapd/daemon.c +++ b/servers/slapd/daemon.c @@ -36,6 +36,7 @@ int deny_severity = LOG_NOTICE; int dtblsize; Connection *c; +static int slapd_shutdown = 0; static void set_shutdown(int sig); static void do_nothing (int sig); @@ -369,14 +370,13 @@ slapd_daemon( } close( tcps ); + pthread_mutex_lock( &active_threads_mutex ); Debug( LDAP_DEBUG_ANY, "slapd shutting down - waiting for %d threads to terminate\n", active_threads, 0, 0 ); while ( active_threads > 0 ) { - pthread_mutex_unlock( &active_threads_mutex ); - pthread_yield(); - pthread_mutex_lock( &active_threads_mutex ); + pthread_cond_wait(&active_threads_cond, &active_threads_mutex); } pthread_mutex_unlock( &active_threads_mutex ); diff --git a/servers/slapd/init.c b/servers/slapd/init.c index 5921fd59f8..527fe16507 100644 --- a/servers/slapd/init.c +++ b/servers/slapd/init.c @@ -11,10 +11,63 @@ #include "portable.h" #include "slap.h" +/* + * read-only global variables or variables only written by the listener + * thread (after they are initialized) - no need to protect them with a mutex. + */ +int slap_debug = 0; + +#ifdef LDAP_DEBUG +int ldap_syslog = LDAP_DEBUG_STATS; +#else +int ldap_syslog; +#endif + +int ldap_syslog_level = LOG_DEBUG; +char *default_referral; +time_t starttime; +pthread_t listener_tid; +int g_argc; +char **g_argv; + +/* + * global variables that need mutex protection + */ +int active_threads; +pthread_mutex_t active_threads_mutex; +pthread_cond_t active_threads_cond; + +time_t currenttime; +pthread_mutex_t currenttime_mutex; + +pthread_mutex_t new_conn_mutex; + +#ifdef SLAPD_CRYPT +pthread_mutex_t crypt_mutex; +#endif +pthread_mutex_t strtok_mutex; + +int num_conns; +long ops_initiated; +long ops_completed; +pthread_mutex_t ops_mutex; + +long num_entries_sent; +long num_bytes_sent; +pthread_mutex_t num_sent_mutex; +/* + * these mutexes must be used when calling the entry2str() + * routine since it returns a pointer to static data. + */ +pthread_mutex_t entry2str_mutex; +pthread_mutex_t replog_mutex; + void init( void ) { pthread_mutex_init( &active_threads_mutex, pthread_mutexattr_default ); + pthread_cond_init( &active_threads_cond, pthread_condattr_default ); + pthread_mutex_init( &new_conn_mutex, pthread_mutexattr_default ); pthread_mutex_init( ¤ttime_mutex, pthread_mutexattr_default ); pthread_mutex_init( &strtok_mutex, pthread_mutexattr_default ); diff --git a/servers/slapd/main.c b/servers/slapd/main.c index b06198a62d..4f8c778bcd 100644 --- a/servers/slapd/main.c +++ b/servers/slapd/main.c @@ -11,52 +11,6 @@ #include "slap.h" #include "lutil.h" /* Get lutil_detach() */ - -/* - * read-only global variables or variables only written by the listener - * thread (after they are initialized) - no need to protect them with a mutex. - */ -int ldap_debug = 0; -#ifdef LDAP_DEBUG -int ldap_syslog = LDAP_DEBUG_STATS; -#else -int ldap_syslog; -#endif -int ldap_syslog_level = LOG_DEBUG; -int udp; -int slapd_shutdown; -char *default_referral; -char *configfile; -time_t starttime; -pthread_t listener_tid; -int g_argc; -char **g_argv; -/* - * global variables that need mutex protection - */ -time_t currenttime; -pthread_mutex_t currenttime_mutex; -pthread_mutex_t strtok_mutex; -int active_threads; -pthread_mutex_t active_threads_mutex; -pthread_mutex_t new_conn_mutex; -#ifdef SLAPD_CRYPT -pthread_mutex_t crypt_mutex; -#endif -long ops_initiated; -long ops_completed; -int num_conns; -pthread_mutex_t ops_mutex; -long num_entries_sent; -long num_bytes_sent; -pthread_mutex_t num_sent_mutex; -/* - * these mutexes must be used when calling the entry2str() - * routine since it returns a pointer to static data. - */ -pthread_mutex_t entry2str_mutex; -pthread_mutex_t replog_mutex; - static void usage( char *name ) { @@ -70,8 +24,10 @@ main( int argc, char **argv ) int inetd = 0; int port; char *myname; + int udp; Backend *be = NULL; FILE *fp = NULL; + char *configfile; configfile = SLAPD_DEFAULT_CONFIGFILE; port = LDAP_PORT; diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index 382f2dbe03..b1cd7bee61 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -239,7 +239,10 @@ extern long num_bytes_sent; extern long num_entries_sent; extern long ops_completed; extern long ops_initiated; + extern pthread_mutex_t active_threads_mutex; +extern pthread_cond_t active_threads_cond; + extern pthread_mutex_t currenttime_mutex; extern pthread_mutex_t strtok_mutex; extern pthread_mutex_t entry2str_mutex; diff --git a/servers/slapd/result.c b/servers/slapd/result.c index dd3613327b..04490d3b72 100644 --- a/servers/slapd/result.c +++ b/servers/slapd/result.c @@ -116,6 +116,10 @@ send_ldap_result2( pthread_kill( listener_tid, LDAP_SIGUSR1 ); pthread_cond_wait( &conn->c_wcv, &active_threads_mutex ); + + if( active_threads < 1 ) { + pthread_cond_signal(&active_threads_cond); + } pthread_mutex_unlock( &active_threads_mutex ); pthread_yield(); @@ -346,6 +350,10 @@ send_search_entry( conn->c_writewaiter = 1; pthread_kill( listener_tid, LDAP_SIGUSR1 ); pthread_cond_wait( &conn->c_wcv, &active_threads_mutex ); + + if( active_threads < 1 ) { + pthread_cond_signal(&active_threads_cond); + } pthread_mutex_unlock( &active_threads_mutex ); pthread_yield(); diff --git a/servers/slapd/tools/ldbmtest.c b/servers/slapd/tools/ldbmtest.c index 4811584cc0..ba3fc163e9 100644 --- a/servers/slapd/tools/ldbmtest.c +++ b/servers/slapd/tools/ldbmtest.c @@ -31,31 +31,9 @@ static void free_and_close(struct dbcache *dbc, Datum key, Datum data); static void edit_entry(char c, Datum *data); static void get_keydata(FILE *fp, char c, Datum *key, Datum *data); -struct dbcache *dbc; -LDBM dbp; -char *tailorfile; -Backend *be = NULL; -int ldap_debug; -int ldap_syslog; -int ldap_syslog_level; -long num_entries_sent; -long num_bytes_sent; -int active_threads; -char *default_referral; -time_t currenttime; -pthread_t listener_tid; -pthread_mutex_t num_sent_mutex; -pthread_mutex_t entry2str_mutex; -pthread_mutex_t active_threads_mutex; -pthread_mutex_t new_conn_mutex; -pthread_mutex_t currenttime_mutex; -pthread_mutex_t strtok_mutex; -pthread_mutex_t replog_mutex; -pthread_mutex_t ops_mutex; -pthread_mutex_t regex_mutex; -#ifdef SLAPD_CRYPT -pthread_mutex_t crypt_mutex; -#endif +static struct dbcache *dbc; +static LDBM dbp; +static Backend *be = NULL; int main( int argc, char **argv ) @@ -67,6 +45,7 @@ main( int argc, char **argv ) IDList *idl; Backend *tbe; int i; + char *tailorfile; #ifdef HAVE_BERKELEY_DB2 DBC *cursorp; diff --git a/servers/slapd/tools/ldif.c b/servers/slapd/tools/ldif.c index 0f4b2ebb67..4f84371cf8 100644 --- a/servers/slapd/tools/ldif.c +++ b/servers/slapd/tools/ldif.c @@ -11,10 +11,6 @@ #include "ldap.h" #include "ldif.h" -int ldap_syslog; -int ldap_syslog_level; - - static void usage( char *name ) { diff --git a/servers/slapd/tools/ldif2id2children.c b/servers/slapd/tools/ldif2id2children.c index 42639726f9..7075bdbef7 100644 --- a/servers/slapd/tools/ldif2id2children.c +++ b/servers/slapd/tools/ldif2id2children.c @@ -16,29 +16,6 @@ #define MAXARGS 100 -int lineno; -int ldap_debug; -int ldap_syslog; -int ldap_syslog_level; -long num_entries_sent; -long num_bytes_sent; -int active_threads; -char *default_referral; -time_t currenttime; -pthread_t listener_tid; -pthread_mutex_t num_sent_mutex; -pthread_mutex_t entry2str_mutex; -pthread_mutex_t active_threads_mutex; -pthread_mutex_t new_conn_mutex; -pthread_mutex_t currenttime_mutex; -pthread_mutex_t strtok_mutex; -pthread_mutex_t replog_mutex; -pthread_mutex_t ops_mutex; -pthread_mutex_t regex_mutex; -#ifdef SLAPD_CRYPT -pthread_mutex_t crypt_mutex; -#endif - static char *tailorfile; static char *inputfile; diff --git a/servers/slapd/tools/ldif2id2entry.c b/servers/slapd/tools/ldif2id2entry.c index 9ba4b71e58..96ed84ffe3 100644 --- a/servers/slapd/tools/ldif2id2entry.c +++ b/servers/slapd/tools/ldif2id2entry.c @@ -14,28 +14,6 @@ #define MAXARGS 100 -int ldap_debug; -int ldap_syslog; -int ldap_syslog_level; -long num_entries_sent; -long num_bytes_sent; -int active_threads; -char *default_referral; -time_t currenttime; -pthread_t listener_tid; -pthread_mutex_t num_sent_mutex; -pthread_mutex_t entry2str_mutex; -pthread_mutex_t active_threads_mutex; -pthread_mutex_t new_conn_mutex; -pthread_mutex_t currenttime_mutex; -pthread_mutex_t strtok_mutex; -pthread_mutex_t replog_mutex; -pthread_mutex_t ops_mutex; -pthread_mutex_t regex_mutex; -#ifdef SLAPD_CRYPT -pthread_mutex_t crypt_mutex; -#endif - static char *tailorfile; static char *inputfile; diff --git a/servers/slapd/tools/ldif2index.c b/servers/slapd/tools/ldif2index.c index a14ecae663..2b39bca046 100644 --- a/servers/slapd/tools/ldif2index.c +++ b/servers/slapd/tools/ldif2index.c @@ -16,29 +16,6 @@ #define MAXARGS 100 -int ldap_debug; -int ldap_syslog; -int ldap_syslog_level; -long num_entries_sent; -long num_bytes_sent; -int active_threads; -char *default_referral; -time_t currenttime; -pthread_t listener_tid; -pthread_mutex_t num_sent_mutex; -pthread_mutex_t entry2str_mutex; -pthread_mutex_t active_threads_mutex; -pthread_mutex_t new_conn_mutex; -pthread_mutex_t currenttime_mutex; -pthread_mutex_t strtok_mutex; -pthread_mutex_t replog_mutex; -pthread_mutex_t ops_mutex; -pthread_mutex_t regex_mutex; -#ifdef SLAPD_CRYPT -pthread_mutex_t crypt_mutex; -#endif - - static void usage( char *name ) { diff --git a/servers/slapd/tools/ldif2ldbm.c b/servers/slapd/tools/ldif2ldbm.c index 39d94c75fe..1f1c641729 100644 --- a/servers/slapd/tools/ldif2ldbm.c +++ b/servers/slapd/tools/ldif2ldbm.c @@ -20,28 +20,6 @@ #define ID2CHILDRENCMD "ldif2id2children" #define MAXARGS 100 -int ldap_debug; -int ldap_syslog; -int ldap_syslog_level; -long num_entries_sent; -long num_bytes_sent; -int active_threads; -char *default_referral; -time_t currenttime; -pthread_t listener_tid; -pthread_mutex_t num_sent_mutex; -pthread_mutex_t entry2str_mutex; -pthread_mutex_t active_threads_mutex; -pthread_mutex_t new_conn_mutex; -pthread_mutex_t currenttime_mutex; -pthread_mutex_t strtok_mutex; -pthread_mutex_t replog_mutex; -pthread_mutex_t ops_mutex; -pthread_mutex_t regex_mutex; -#ifdef SLAPD_CRYPT -pthread_mutex_t crypt_mutex; -#endif - static void fork_child( char *prog, char *args[] ); static void wait4kids( int nkidval );