From fab3c713ba8e7384fe1fa404d2e93e50cf161ab1 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Mon, 21 Apr 2003 12:55:47 +0000 Subject: [PATCH] Implement bmicrosleep and run when git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@451 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/autoconf/config.h.in | 3 + bacula/autoconf/configure.in | 1 + bacula/configure | 755 +++++++++++++++++-------------- bacula/kernstodo | 7 +- bacula/src/dird/job.c | 18 +- bacula/src/dird/scheduler.c | 13 +- bacula/src/dird/ua_cmds.c | 5 +- bacula/src/dird/ua_run.c | 76 +++- bacula/src/filed/authenticate.c | 2 +- bacula/src/lib/bnet.c | 2 +- bacula/src/lib/bnet_server.c | 8 +- bacula/src/lib/bpipe.c | 2 +- bacula/src/lib/btime.c | 22 + bacula/src/lib/btime.h | 44 +- bacula/src/lib/cram-md5.c | 12 +- bacula/src/lib/protos.h | 199 ++++---- bacula/src/lib/signal.c | 2 +- bacula/src/lib/watchdog.c | 30 +- bacula/src/stored/authenticate.c | 2 +- bacula/src/stored/dev.c | 4 +- bacula/src/stored/dircmd.c | 2 +- bacula/src/stored/stored.c | 2 +- 22 files changed, 670 insertions(+), 541 deletions(-) diff --git a/bacula/autoconf/config.h.in b/bacula/autoconf/config.h.in index 94acb5c1e3..6514b07aa8 100644 --- a/bacula/autoconf/config.h.in +++ b/bacula/autoconf/config.h.in @@ -342,6 +342,9 @@ /* Define if you have the lstat function. */ #undef HAVE_LSTAT +/* Define if you have the nanosleep function. */ +#undef HAVE_NANOSLEEP + /* Define if you have the putenv function. */ #undef HAVE_PUTENV diff --git a/bacula/autoconf/configure.in b/bacula/autoconf/configure.in index 2d10c4b771..dcdd09d5fd 100644 --- a/bacula/autoconf/configure.in +++ b/bacula/autoconf/configure.in @@ -346,6 +346,7 @@ AC_HEADER_STAT AC_HEADER_DIRENT AC_CHECK_FUNCS(strcasecmp select setenv putenv tcgetattr setlocale lstat lchown) +AC_CHECK_FUNCS(nanosleep) #AC_CHECK_FUNC(getopt_long, AC_DEFINE(HAVE_GETOPT_LONG), # [LIBEXTRAOBJ="$LIBEXTRAOBJ getopt.o getopt1.o" diff --git a/bacula/configure b/bacula/configure index 147d1571d6..a8d4b9bffe 100755 --- a/bacula/configure +++ b/bacula/configure @@ -3242,18 +3242,73 @@ else fi done +for ac_func in nanosleep +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:3249: 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:3277: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; 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 + #AC_CHECK_FUNC(getopt_long, AC_DEFINE(HAVE_GETOPT_LONG), # [LIBEXTRAOBJ="$LIBEXTRAOBJ getopt.o getopt1.o" # EXTRAOBJ="$EXTRAOBJ lib/getopt.o lib/getopt1.o"]) echo $ac_n "checking for getopt_long""... $ac_c" 1>&6 -echo "configure:3252: checking for getopt_long" >&5 +echo "configure:3307: checking for getopt_long" >&5 if eval "test \"`echo '$''{'ac_cv_func_getopt_long'+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${ac_exeext}; then +if { (eval echo configure:3335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_getopt_long=yes" else @@ -3301,7 +3356,7 @@ fi echo $ac_n "checking for working strcoll""... $ac_c" 1>&6 -echo "configure:3305: checking for working strcoll" >&5 +echo "configure:3360: checking for working strcoll" >&5 if eval "test \"`echo '$''{'ac_cv_func_strcoll_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3309,7 +3364,7 @@ else ac_cv_func_strcoll_works=no else cat > conftest.$ac_ext < main () @@ -3319,7 +3374,7 @@ main () strcoll ("123", "456") >= 0); } EOF -if { (eval echo configure:3323: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_strcoll_works=yes else @@ -3347,17 +3402,17 @@ for ac_hdr in varargs.h \ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3351: checking for $ac_hdr" >&5 +echo "configure:3406: 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:3361: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3416: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3522,9 +3577,9 @@ if test "${with_tcp_wrappers+set}" = set; then saved_LIBS="$LIBS" LIBS="$LIBS -lwrap -lnsl" echo $ac_n "checking for libwrap""... $ac_c" 1>&6 -echo "configure:3526: checking for libwrap" >&5 +echo "configure:3581: checking for libwrap" >&5 cat > conftest.$ac_ext < int deny_severity = 0; @@ -3534,7 +3589,7 @@ int main() { hosts_access(req); ; return 0; } EOF -if { (eval echo configure:3538: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6 @@ -3806,7 +3861,7 @@ fi db_found=no echo $ac_n "checking for MySQL support""... $ac_c" 1>&6 -echo "configure:3810: checking for MySQL support" >&5 +echo "configure:3865: checking for MySQL support" >&5 # Check whether --with-mysql or --without-mysql was given. if test "${with_mysql+set}" = set; then withval="$with_mysql" @@ -3963,7 +4018,7 @@ fi db_found=no echo $ac_n "checking for SQLite support""... $ac_c" 1>&6 -echo "configure:3967: checking for SQLite support" >&5 +echo "configure:4022: checking for SQLite support" >&5 # Check whether --with-sqlite or --without-sqlite was given. if test "${with_sqlite+set}" = set; then withval="$with_sqlite" @@ -4039,19 +4094,19 @@ fi echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:4043: checking for mingw32 environment" >&5 +echo "configure:4098: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+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:4110: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -4070,7 +4125,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:4074: checking for executable suffix" >&5 +echo "configure:4129: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4080,7 +4135,7 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:4084: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:4139: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj) ;; @@ -4103,7 +4158,7 @@ ac_exeext=$EXEEXT largefile_support="no" echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:4107: checking build system type" >&5 +echo "configure:4162: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -4137,7 +4192,7 @@ fi # Extract the first word of "${ac_tool_prefix}getconf", so it can be a program name with args. set dummy ${ac_tool_prefix}getconf; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4141: checking for $ac_word" >&5 +echo "configure:4196: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_GETCONF'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4167,7 +4222,7 @@ fi echo $ac_n "checking for CFLAGS value to request large file support""... $ac_c" 1>&6 -echo "configure:4171: checking for CFLAGS value to request large file support" >&5 +echo "configure:4226: checking for CFLAGS value to request large file support" >&5 if eval "test \"`echo '$''{'ac_cv_sys_largefile_CFLAGS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4182,14 +4237,14 @@ else ac_save_CC="$CC" CC="$CC $ac_cv_sys_largefile_CFLAGS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4248: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then : else echo "configure: failed program was:" >&5 @@ -4205,7 +4260,7 @@ fi echo "$ac_t""$ac_cv_sys_largefile_CFLAGS" 1>&6 echo $ac_n "checking for LDFLAGS value to request large file support""... $ac_c" 1>&6 -echo "configure:4209: checking for LDFLAGS value to request large file support" >&5 +echo "configure:4264: checking for LDFLAGS value to request large file support" >&5 if eval "test \"`echo '$''{'ac_cv_sys_largefile_LDFLAGS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4217,7 +4272,7 @@ fi echo "$ac_t""$ac_cv_sys_largefile_LDFLAGS" 1>&6 echo $ac_n "checking for LIBS value to request large file support""... $ac_c" 1>&6 -echo "configure:4221: checking for LIBS value to request large file support" >&5 +echo "configure:4276: checking for LIBS value to request large file support" >&5 if eval "test \"`echo '$''{'ac_cv_sys_largefile_LIBS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4272,7 +4327,7 @@ echo "$ac_t""$ac_cv_sys_largefile_LIBS" 1>&6 esac ;; esac echo $ac_n "checking for _FILE_OFFSET_BITS""... $ac_c" 1>&6 -echo "configure:4276: checking for _FILE_OFFSET_BITS" >&5 +echo "configure:4331: checking for _FILE_OFFSET_BITS" >&5 if eval "test \"`echo '$''{'ac_cv_sys_file_offset_bits'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4301,7 +4356,7 @@ EOF fi echo $ac_n "checking for _LARGEFILE_SOURCE""... $ac_c" 1>&6 -echo "configure:4305: checking for _LARGEFILE_SOURCE" >&5 +echo "configure:4360: checking for _LARGEFILE_SOURCE" >&5 if eval "test \"`echo '$''{'ac_cv_sys_largefile_source'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4330,7 +4385,7 @@ EOF fi echo $ac_n "checking for _LARGE_FILES""... $ac_c" 1>&6 -echo "configure:4334: checking for _LARGE_FILES" >&5 +echo "configure:4389: checking for _LARGE_FILES" >&5 if eval "test \"`echo '$''{'ac_cv_sys_large_files'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4367,7 +4422,7 @@ EOF # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 -echo "configure:4371: checking for X" >&5 +echo "configure:4426: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -4429,12 +4484,12 @@ if test "$ac_x_includes" = NO; then # First, try using that file with no special directory specified. cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4438: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4493: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4503,14 +4558,14 @@ if test "$ac_x_libraries" = NO; then ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4569: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. @@ -4616,17 +4671,17 @@ else case "`(uname -sr) 2>/dev/null`" in "SunOS 5"*) echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6 -echo "configure:4620: checking whether -R must be followed by a space" >&5 +echo "configure:4675: checking whether -R must be followed by a space" >&5 ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_R_nospace=yes else @@ -4642,14 +4697,14 @@ rm -f conftest* else LIBS="$ac_xsave_LIBS -R $x_libraries" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4708: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_R_space=yes else @@ -4681,7 +4736,7 @@ rm -f conftest* # libraries were built with DECnet support. And karl@cs.umb.edu says # the Alpha needs dnet_stub (dnet does not exist). echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6 -echo "configure:4685: checking for dnet_ntoa in -ldnet" >&5 +echo "configure:4740: checking for dnet_ntoa in -ldnet" >&5 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4689,7 +4744,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldnet $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4759: \"$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 @@ -4722,7 +4777,7 @@ fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6 -echo "configure:4726: checking for dnet_ntoa in -ldnet_stub" >&5 +echo "configure:4781: checking for dnet_ntoa in -ldnet_stub" >&5 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4730,7 +4785,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldnet_stub $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4800: \"$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 @@ -4770,12 +4825,12 @@ fi # The nsl library prevents programs from opening the X display # on Irix 5.2, according to dickey@clark.net. echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 -echo "configure:4774: checking for gethostbyname" >&5 +echo "configure:4829: checking for gethostbyname" >&5 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+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${ac_exeext}; then +if { (eval echo configure:4857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else @@ -4819,7 +4874,7 @@ fi if test $ac_cv_func_gethostbyname = no; then echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:4823: checking for gethostbyname in -lnsl" >&5 +echo "configure:4878: checking for gethostbyname in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4827,7 +4882,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4897: \"$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 @@ -4868,12 +4923,12 @@ fi # -lsocket must be given before -lnsl if both are needed. # We assume that if connect needs -lnsl, so does gethostbyname. echo $ac_n "checking for connect""... $ac_c" 1>&6 -echo "configure:4872: checking for connect" >&5 +echo "configure:4927: checking for connect" >&5 if eval "test \"`echo '$''{'ac_cv_func_connect'+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${ac_exeext}; then +if { (eval echo configure:4955: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_connect=yes" else @@ -4917,7 +4972,7 @@ fi if test $ac_cv_func_connect = no; then echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6 -echo "configure:4921: checking for connect in -lsocket" >&5 +echo "configure:4976: checking for connect in -lsocket" >&5 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4925,7 +4980,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4995: \"$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 @@ -4960,12 +5015,12 @@ fi # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX. echo $ac_n "checking for remove""... $ac_c" 1>&6 -echo "configure:4964: checking for remove" >&5 +echo "configure:5019: checking for remove" >&5 if eval "test \"`echo '$''{'ac_cv_func_remove'+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${ac_exeext}; then +if { (eval echo configure:5047: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_remove=yes" else @@ -5009,7 +5064,7 @@ fi if test $ac_cv_func_remove = no; then echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6 -echo "configure:5013: checking for remove in -lposix" >&5 +echo "configure:5068: checking for remove in -lposix" >&5 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5017,7 +5072,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lposix $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5087: \"$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 @@ -5052,12 +5107,12 @@ fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. echo $ac_n "checking for shmat""... $ac_c" 1>&6 -echo "configure:5056: checking for shmat" >&5 +echo "configure:5111: checking for shmat" >&5 if eval "test \"`echo '$''{'ac_cv_func_shmat'+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${ac_exeext}; then +if { (eval echo configure:5139: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_shmat=yes" else @@ -5101,7 +5156,7 @@ fi if test $ac_cv_func_shmat = no; then echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6 -echo "configure:5105: checking for shmat in -lipc" >&5 +echo "configure:5160: checking for shmat in -lipc" >&5 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5109,7 +5164,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lipc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5179: \"$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 @@ -5153,7 +5208,7 @@ fi # libraries we check for below, so use a different variable. # --interran@uluru.Stanford.EDU, kb@cs.umb.edu. echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6 -echo "configure:5157: checking for IceConnectionNumber in -lICE" >&5 +echo "configure:5212: checking for IceConnectionNumber in -lICE" >&5 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5161,7 +5216,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5231: \"$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 @@ -5224,17 +5279,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:5228: checking for $ac_hdr" >&5 +echo "configure:5283: 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:5238: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5293: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5261,12 +5316,12 @@ fi done echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:5265: checking for ANSI C header files" >&5 +echo "configure:5320: 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 @@ -5274,7 +5329,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5278: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5333: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5291,7 +5346,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 @@ -5309,7 +5364,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 @@ -5330,7 +5385,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -5341,7 +5396,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:5345: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5400: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -5365,19 +5420,19 @@ EOF fi echo $ac_n "checking whether sys/types.h defines makedev""... $ac_c" 1>&6 -echo "configure:5369: checking whether sys/types.h defines makedev" >&5 +echo "configure:5424: checking whether sys/types.h defines makedev" >&5 if eval "test \"`echo '$''{'ac_cv_header_sys_types_h_makedev'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return makedev(0, 0); ; return 0; } EOF -if { (eval echo configure:5381: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5436: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_sys_types_h_makedev=yes else @@ -5395,17 +5450,17 @@ echo "$ac_t""$ac_cv_header_sys_types_h_makedev" 1>&6 if test $ac_cv_header_sys_types_h_makedev = no; then ac_safe=`echo "sys/mkdev.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/mkdev.h""... $ac_c" 1>&6 -echo "configure:5399: checking for sys/mkdev.h" >&5 +echo "configure:5454: checking for sys/mkdev.h" >&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:5409: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5464: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5433,17 +5488,17 @@ fi if test $ac_cv_header_sys_mkdev_h = no; then ac_safe=`echo "sys/sysmacros.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/sysmacros.h""... $ac_c" 1>&6 -echo "configure:5437: checking for sys/sysmacros.h" >&5 +echo "configure:5492: checking for sys/sysmacros.h" >&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:5447: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5502: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5475,12 +5530,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:5479: checking for $ac_hdr that defines DIR" >&5 +echo "configure:5534: 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> @@ -5488,7 +5543,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:5492: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5547: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -5513,7 +5568,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:5517: checking for opendir in -ldir" >&5 +echo "configure:5572: 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 @@ -5521,7 +5576,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5591: \"$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 @@ -5554,7 +5609,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:5558: checking for opendir in -lx" >&5 +echo "configure:5613: 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 @@ -5562,7 +5617,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5632: \"$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 @@ -5596,12 +5651,12 @@ fi fi echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6 -echo "configure:5600: checking whether stat file-mode macros are broken" >&5 +echo "configure:5655: checking whether stat file-mode macros are broken" >&5 if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -5652,12 +5707,12 @@ EOF fi echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:5656: checking for sys/wait.h that is POSIX.1 compatible" >&5 +echo "configure:5711: 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 @@ -5673,7 +5728,7 @@ wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:5677: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5732: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else @@ -5694,12 +5749,12 @@ EOF fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:5698: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:5753: 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 @@ -5708,7 +5763,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:5712: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5767: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -5729,12 +5784,12 @@ EOF fi echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6 -echo "configure:5733: checking for st_blksize in struct stat" >&5 +echo "configure:5788: 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 @@ -5742,7 +5797,7 @@ int main() { struct stat s; s.st_blksize; ; return 0; } EOF -if { (eval echo configure:5746: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5801: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_blksize=yes else @@ -5763,12 +5818,12 @@ EOF fi echo $ac_n "checking for st_blocks in struct stat""... $ac_c" 1>&6 -echo "configure:5767: checking for st_blocks in struct stat" >&5 +echo "configure:5822: checking for st_blocks in struct stat" >&5 if eval "test \"`echo '$''{'ac_cv_struct_st_blocks'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -5776,7 +5831,7 @@ int main() { struct stat s; s.st_blocks; ; return 0; } EOF -if { (eval echo configure:5780: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5835: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_blocks=yes else @@ -5799,12 +5854,12 @@ else fi echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 -echo "configure:5803: checking whether struct tm is in sys/time.h or time.h" >&5 +echo "configure:5858: 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 @@ -5812,7 +5867,7 @@ int main() { struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:5816: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5871: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -5833,12 +5888,12 @@ EOF fi echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6 -echo "configure:5837: checking for tm_zone in struct tm" >&5 +echo "configure:5892: checking for tm_zone in struct tm" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_cv_struct_tm> @@ -5846,7 +5901,7 @@ int main() { struct tm tm; tm.tm_zone; ; return 0; } EOF -if { (eval echo configure:5850: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5905: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm_zone=yes else @@ -5866,12 +5921,12 @@ EOF else echo $ac_n "checking for tzname""... $ac_c" 1>&6 -echo "configure:5870: checking for tzname" >&5 +echo "configure:5925: checking for tzname" >&5 if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #ifndef tzname /* For SGI. */ @@ -5881,7 +5936,7 @@ int main() { atoi(*tzname); ; return 0; } EOF -if { (eval echo configure:5885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5940: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_var_tzname=yes else @@ -5904,12 +5959,12 @@ fi echo $ac_n "checking for utime.h""... $ac_c" 1>&6 -echo "configure:5908: checking for utime.h" >&5 +echo "configure:5963: checking for utime.h" >&5 if eval "test \"`echo '$''{'ba_cv_header_utime_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -5918,7 +5973,7 @@ int main() { struct utimbuf foo ; return 0; } EOF -if { (eval echo configure:5922: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5977: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ba_cv_header_utime_h=yes else @@ -5937,12 +5992,12 @@ EOF echo $ac_n "checking for socklen_t""... $ac_c" 1>&6 -echo "configure:5941: checking for socklen_t" >&5 +echo "configure:5996: checking for socklen_t" >&5 if eval "test \"`echo '$''{'ba_cv_header_socklen_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -5951,7 +6006,7 @@ int main() { socklen_t x ; return 0; } EOF -if { (eval echo configure:5955: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6010: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ba_cv_header_socklen_t=yes else @@ -5970,7 +6025,7 @@ EOF echo $ac_n "checking for bigendian""... $ac_c" 1>&6 -echo "configure:5974: checking for bigendian" >&5 +echo "configure:6029: checking for bigendian" >&5 if eval "test \"`echo '$''{'ba_cv_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -5978,11 +6033,11 @@ else ba_cv_bigendian=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6041: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ba_cv_bigendian=yes else @@ -6004,12 +6059,12 @@ EOF echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:6008: checking for working const" >&5 +echo "configure:6063: 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:6117: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -6081,17 +6136,17 @@ fi echo $ac_n "checking how to get filesystem type""... $ac_c" 1>&6 -echo "configure:6085: checking how to get filesystem type" >&5 +echo "configure:6140: checking how to get filesystem type" >&5 fstype=no # The order of these tests is important. cat > conftest.$ac_ext < #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6095: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6150: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6107,13 +6162,13 @@ fi rm -f conftest* if test $fstype = no; then cat > conftest.$ac_ext < #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6117: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6172: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6130,13 +6185,13 @@ rm -f conftest* fi if test $fstype = no; then cat > conftest.$ac_ext < #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6140: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6195: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6153,12 +6208,12 @@ rm -f conftest* fi if test $fstype = no; then cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6162: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6217: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6175,7 +6230,7 @@ rm -f conftest* fi if test $fstype = no; then cat > conftest.$ac_ext < EOF @@ -6192,13 +6247,13 @@ rm -f conftest* fi if test $fstype = no; then cat > conftest.$ac_ext < #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6202: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6257: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -6216,12 +6271,12 @@ fi echo "$ac_t""$fstype" 1>&6 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:6220: checking return type of signal handlers" >&5 +echo "configure:6275: 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 @@ -6238,7 +6293,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:6242: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6297: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -6258,13 +6313,13 @@ EOF echo $ac_n "checking for type of signal functions""... $ac_c" 1>&6 -echo "configure:6262: checking for type of signal functions" >&5 +echo "configure:6317: checking for type of signal functions" >&5 if eval "test \"`echo '$''{'bash_cv_signal_vintage'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { @@ -6277,7 +6332,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:6281: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* bash_cv_signal_vintage=posix else @@ -6286,7 +6341,7 @@ else rm -rf conftest* cat > conftest.$ac_ext < int main() { @@ -6296,7 +6351,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:6300: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6355: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* bash_cv_signal_vintage=4.2bsd else @@ -6305,7 +6360,7 @@ else rm -rf conftest* cat > conftest.$ac_ext < @@ -6318,7 +6373,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:6322: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* bash_cv_signal_vintage=svr3 else @@ -6357,12 +6412,12 @@ EOF fi echo $ac_n "checking for mode_t""... $ac_c" 1>&6 -echo "configure:6361: checking for mode_t" >&5 +echo "configure:6416: 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 @@ -6390,12 +6445,12 @@ EOF fi echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:6394: checking for uid_t in sys/types.h" >&5 +echo "configure:6449: 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 @@ -6424,12 +6479,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:6428: checking for size_t" >&5 +echo "configure:6483: 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 @@ -6457,12 +6512,12 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:6461: checking for pid_t" >&5 +echo "configure:6516: 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 @@ -6490,12 +6545,12 @@ EOF fi echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:6494: checking for off_t" >&5 +echo "configure:6549: 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 @@ -6523,12 +6578,12 @@ EOF fi echo $ac_n "checking for ino_t""... $ac_c" 1>&6 -echo "configure:6527: checking for ino_t" >&5 +echo "configure:6582: checking for ino_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_ino_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -6556,12 +6611,12 @@ EOF fi echo $ac_n "checking for dev_t""... $ac_c" 1>&6 -echo "configure:6560: checking for dev_t" >&5 +echo "configure:6615: checking for dev_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_dev_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -6589,12 +6644,12 @@ EOF fi echo $ac_n "checking for daddr_t""... $ac_c" 1>&6 -echo "configure:6593: checking for daddr_t" >&5 +echo "configure:6648: checking for daddr_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_daddr_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -6622,12 +6677,12 @@ EOF fi echo $ac_n "checking for major_t""... $ac_c" 1>&6 -echo "configure:6626: checking for major_t" >&5 +echo "configure:6681: checking for major_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_major_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -6655,12 +6710,12 @@ EOF fi echo $ac_n "checking for minor_t""... $ac_c" 1>&6 -echo "configure:6659: checking for minor_t" >&5 +echo "configure:6714: checking for minor_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_minor_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -6688,12 +6743,12 @@ EOF fi echo $ac_n "checking for ssize_t""... $ac_c" 1>&6 -echo "configure:6692: checking for ssize_t" >&5 +echo "configure:6747: checking for ssize_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -6721,12 +6776,12 @@ EOF fi echo $ac_n "checking for st_blocks in struct stat""... $ac_c" 1>&6 -echo "configure:6725: checking for st_blocks in struct stat" >&5 +echo "configure:6780: checking for st_blocks in struct stat" >&5 if eval "test \"`echo '$''{'ac_cv_struct_st_blocks'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -6734,7 +6789,7 @@ int main() { struct stat s; s.st_blocks; ; return 0; } EOF -if { (eval echo configure:6738: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6793: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_blocks=yes else @@ -6757,12 +6812,12 @@ else fi echo $ac_n "checking for st_rdev in struct stat""... $ac_c" 1>&6 -echo "configure:6761: checking for st_rdev in struct stat" >&5 +echo "configure:6816: checking for st_rdev in struct stat" >&5 if eval "test \"`echo '$''{'ac_cv_struct_st_rdev'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -6770,7 +6825,7 @@ int main() { struct stat s; s.st_rdev; ; return 0; } EOF -if { (eval echo configure:6774: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6829: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_rdev=yes else @@ -6791,12 +6846,12 @@ EOF fi echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 -echo "configure:6795: checking whether struct tm is in sys/time.h or time.h" >&5 +echo "configure:6850: 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 @@ -6804,7 +6859,7 @@ int main() { struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:6808: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6863: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -6825,12 +6880,12 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:6829: checking for working const" >&5 +echo "configure:6884: 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:6938: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -6902,7 +6957,7 @@ fi echo $ac_n "checking size of char""... $ac_c" 1>&6 -echo "configure:6906: checking size of char" >&5 +echo "configure:6961: checking size of char" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_char'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6910,7 +6965,7 @@ else ac_cv_sizeof_char=1 else cat > conftest.$ac_ext < int main() @@ -6921,7 +6976,7 @@ int main() return(0); } EOF -if { (eval echo configure:6925: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6980: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_char=`cat conftestval` else @@ -6941,7 +6996,7 @@ EOF echo $ac_n "checking size of short int""... $ac_c" 1>&6 -echo "configure:6945: checking size of short int" >&5 +echo "configure:7000: checking size of short int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_short_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -6949,7 +7004,7 @@ else ac_cv_sizeof_short_int=2 else cat > conftest.$ac_ext < int main() @@ -6960,7 +7015,7 @@ int main() return(0); } EOF -if { (eval echo configure:6964: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7019: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_short_int=`cat conftestval` else @@ -6980,7 +7035,7 @@ EOF echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:6984: checking size of int" >&5 +echo "configure:7039: 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 @@ -6988,7 +7043,7 @@ else ac_cv_sizeof_int=4 else cat > conftest.$ac_ext < int main() @@ -6999,7 +7054,7 @@ int main() return(0); } EOF -if { (eval echo configure:7003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7058: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int=`cat conftestval` else @@ -7019,7 +7074,7 @@ EOF echo $ac_n "checking size of long int""... $ac_c" 1>&6 -echo "configure:7023: checking size of long int" >&5 +echo "configure:7078: checking size of long int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7027,7 +7082,7 @@ else ac_cv_sizeof_long_int=4 else cat > conftest.$ac_ext < int main() @@ -7038,7 +7093,7 @@ int main() return(0); } EOF -if { (eval echo configure:7042: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7097: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long_int=`cat conftestval` else @@ -7058,7 +7113,7 @@ EOF echo $ac_n "checking size of long long int""... $ac_c" 1>&6 -echo "configure:7062: checking size of long long int" >&5 +echo "configure:7117: checking size of long long int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long_long_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7066,7 +7121,7 @@ else ac_cv_sizeof_long_long_int=8 else cat > conftest.$ac_ext < int main() @@ -7077,7 +7132,7 @@ int main() return(0); } EOF -if { (eval echo configure:7081: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7136: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long_long_int=`cat conftestval` else @@ -7097,7 +7152,7 @@ EOF echo $ac_n "checking size of int *""... $ac_c" 1>&6 -echo "configure:7101: checking size of int *" >&5 +echo "configure:7156: checking size of int *" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int_p'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -7105,7 +7160,7 @@ else ac_cv_sizeof_int_p=4 else cat > conftest.$ac_ext < int main() @@ -7116,7 +7171,7 @@ int main() return(0); } EOF -if { (eval echo configure:7120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7175: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int_p=`cat conftestval` else @@ -7138,20 +7193,20 @@ EOF # Check for sys/types.h types echo $ac_n "checking for u_int type""... $ac_c" 1>&6 -echo "configure:7142: checking for u_int type" >&5 +echo "configure:7197: checking for u_int type" >&5 if eval "test \"`echo '$''{'ac_cv_have_u_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { u_int a; a = 1; ; return 0; } EOF -if { (eval echo configure:7155: \"$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_have_u_int="yes" else @@ -7175,20 +7230,20 @@ EOF fi echo $ac_n "checking for intmax_t type""... $ac_c" 1>&6 -echo "configure:7179: checking for intmax_t type" >&5 +echo "configure:7234: checking for intmax_t type" >&5 if eval "test \"`echo '$''{'ac_cv_have_intmax_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { intmax_t a; a = 1; ; return 0; } EOF -if { (eval echo configure:7192: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7247: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_intmax_t="yes" else @@ -7197,14 +7252,14 @@ else rm -rf conftest* cat > conftest.$ac_ext < int main() { intmax_t a; a = 1; ; return 0; } EOF -if { (eval echo configure:7208: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7263: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_intmax_t="yes" else @@ -7234,20 +7289,20 @@ fi echo $ac_n "checking for u_intmax_t type""... $ac_c" 1>&6 -echo "configure:7238: checking for u_intmax_t type" >&5 +echo "configure:7293: checking for u_intmax_t type" >&5 if eval "test \"`echo '$''{'ac_cv_have_u_intmax_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { u_intmax_t a; a = 1; ; return 0; } EOF -if { (eval echo configure:7251: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7306: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_u_intmax_t="yes" else @@ -7256,14 +7311,14 @@ else rm -rf conftest* cat > conftest.$ac_ext < int main() { u_intmax_t a; a = 1; ; return 0; } EOF -if { (eval echo configure:7267: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7322: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_u_intmax_t="yes" else @@ -7292,20 +7347,20 @@ fi echo $ac_n "checking for intXX_t types""... $ac_c" 1>&6 -echo "configure:7296: checking for intXX_t types" >&5 +echo "configure:7351: checking for intXX_t types" >&5 if eval "test \"`echo '$''{'ac_cv_have_intxx_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { int8_t a; int16_t b; int32_t c; a = b = c = 1; ; return 0; } EOF -if { (eval echo configure:7309: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7364: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_intxx_t="yes" else @@ -7329,20 +7384,20 @@ EOF fi echo $ac_n "checking for int64_t type""... $ac_c" 1>&6 -echo "configure:7333: checking for int64_t type" >&5 +echo "configure:7388: checking for int64_t type" >&5 if eval "test \"`echo '$''{'ac_cv_have_int64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { int64_t a; a = 1; ; return 0; } EOF -if { (eval echo configure:7346: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7401: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_int64_t="yes" else @@ -7366,20 +7421,20 @@ EOF fi echo $ac_n "checking for u_intXX_t types""... $ac_c" 1>&6 -echo "configure:7370: checking for u_intXX_t types" >&5 +echo "configure:7425: checking for u_intXX_t types" >&5 if eval "test \"`echo '$''{'ac_cv_have_u_intxx_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1; ; return 0; } EOF -if { (eval echo configure:7383: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7438: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_u_intxx_t="yes" else @@ -7403,20 +7458,20 @@ EOF fi echo $ac_n "checking for u_int64_t types""... $ac_c" 1>&6 -echo "configure:7407: checking for u_int64_t types" >&5 +echo "configure:7462: checking for u_int64_t types" >&5 if eval "test \"`echo '$''{'ac_cv_have_u_int64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { u_int64_t a; a = 1; ; return 0; } EOF -if { (eval echo configure:7420: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7475: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_u_int64_t="yes" else @@ -7443,9 +7498,9 @@ if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \ test "x$ac_cv_header_sys_bitypes_h" = "xyes") then echo $ac_n "checking for intXX_t and u_intXX_t types in sys/bitypes.h""... $ac_c" 1>&6 -echo "configure:7447: checking for intXX_t and u_intXX_t types in sys/bitypes.h" >&5 +echo "configure:7502: checking for intXX_t and u_intXX_t types in sys/bitypes.h" >&5 cat > conftest.$ac_ext < int main() { @@ -7454,7 +7509,7 @@ int main() { a = b = c = e = f = g = 1; ; return 0; } EOF -if { (eval echo configure:7458: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7513: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_U_INTXX_T 1 @@ -7481,13 +7536,13 @@ fi if test -z "$have_u_intxx_t" ; then echo $ac_n "checking for uintXX_t types""... $ac_c" 1>&6 -echo "configure:7485: checking for uintXX_t types" >&5 +echo "configure:7540: checking for uintXX_t types" >&5 if eval "test \"`echo '$''{'ac_cv_have_uintxx_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { @@ -7495,7 +7550,7 @@ int main() { uint32_t c; a = b = c = 1; ; return 0; } EOF -if { (eval echo configure:7499: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7554: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_uintxx_t="yes" else @@ -7536,12 +7591,12 @@ for ac_func in \ do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7540: checking for $ac_func" >&5 +echo "configure:7595: 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${ac_exeext}; then +if { (eval echo configure:7623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7594,12 +7649,12 @@ done for ac_func in fchdir do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7598: checking for $ac_func" >&5 +echo "configure:7653: 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${ac_exeext}; then +if { (eval echo configure:7681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7653,12 +7708,12 @@ done for ac_func in chflags do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7657: checking for $ac_func" >&5 +echo "configure:7712: 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${ac_exeext}; then +if { (eval echo configure:7740: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7709,12 +7764,12 @@ done for ac_func in snprintf vsnprintf gethostid getdomainname do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7713: checking for $ac_func" >&5 +echo "configure:7768: 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${ac_exeext}; then +if { (eval echo configure:7796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7765,12 +7820,12 @@ done for ac_func in localtime_r readdir_r strerror_r gethostbyname_r do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7769: checking for $ac_func" >&5 +echo "configure:7824: 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${ac_exeext}; then +if { (eval echo configure:7852: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7820,12 +7875,12 @@ done # If resolver functions are not in libc check for -lnsl or -lresolv. echo $ac_n "checking for gethostbyname_r""... $ac_c" 1>&6 -echo "configure:7824: checking for gethostbyname_r" >&5 +echo "configure:7879: checking for gethostbyname_r" >&5 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname_r'+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${ac_exeext}; then +if { (eval echo configure:7907: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gethostbyname_r=yes" else @@ -7866,7 +7921,7 @@ if eval "test \"`echo '$ac_cv_func_'gethostbyname_r`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for gethostbyname_r in -lnsl""... $ac_c" 1>&6 -echo "configure:7870: checking for gethostbyname_r in -lnsl" >&5 +echo "configure:7925: checking for gethostbyname_r in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname_r | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7874,7 +7929,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7944: \"$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 @@ -7913,7 +7968,7 @@ else fi echo $ac_n "checking for gethostbyname_r in -lresolv""... $ac_c" 1>&6 -echo "configure:7917: checking for gethostbyname_r in -lresolv" >&5 +echo "configure:7972: checking for gethostbyname_r in -lresolv" >&5 ac_lib_var=`echo resolv'_'gethostbyname_r | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7921,7 +7976,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lresolv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7991: \"$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 @@ -7965,12 +8020,12 @@ fi # Find where sockets are (especially for Solaris) echo $ac_n "checking for socket""... $ac_c" 1>&6 -echo "configure:7969: checking for socket" >&5 +echo "configure:8024: checking for socket" >&5 if eval "test \"`echo '$''{'ac_cv_func_socket'+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${ac_exeext}; then +if { (eval echo configure:8052: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_socket=yes" else @@ -8011,7 +8066,7 @@ if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for socket in -lxnet""... $ac_c" 1>&6 -echo "configure:8015: checking for socket in -lxnet" >&5 +echo "configure:8070: checking for socket in -lxnet" >&5 ac_lib_var=`echo xnet'_'socket | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8019,7 +8074,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lxnet $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8089: \"$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 @@ -8058,7 +8113,7 @@ else fi echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6 -echo "configure:8062: checking for socket in -lsocket" >&5 +echo "configure:8117: checking for socket in -lsocket" >&5 ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8066,7 +8121,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8136: \"$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 @@ -8105,7 +8160,7 @@ else fi echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6 -echo "configure:8109: checking for socket in -linet" >&5 +echo "configure:8164: checking for socket in -linet" >&5 ac_lib_var=`echo inet'_'socket | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8113,7 +8168,7 @@ else ac_save_LIBS="$LIBS" LIBS="-linet $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8183: \"$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 @@ -8157,12 +8212,12 @@ fi for ac_func in inet_pton do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:8161: checking for $ac_func" >&5 +echo "configure:8216: 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${ac_exeext}; then +if { (eval echo configure:8244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -8214,12 +8269,12 @@ done echo $ac_n "checking for strftime""... $ac_c" 1>&6 -echo "configure:8218: checking for strftime" >&5 +echo "configure:8273: 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${ac_exeext}; then +if { (eval echo configure:8301: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_strftime=yes" else @@ -8264,7 +8319,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:8268: checking for strftime in -lintl" >&5 +echo "configure:8323: 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 @@ -8272,7 +8327,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8342: \"$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 @@ -8310,12 +8365,12 @@ fi fi echo $ac_n "checking for vprintf""... $ac_c" 1>&6 -echo "configure:8314: checking for vprintf" >&5 +echo "configure:8369: 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${ac_exeext}; then +if { (eval echo configure:8397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" else @@ -8362,12 +8417,12 @@ fi if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:8366: checking for _doprnt" >&5 +echo "configure:8421: 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${ac_exeext}; then +if { (eval echo configure:8449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" else @@ -8417,19 +8472,19 @@ fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:8421: checking for working alloca.h" >&5 +echo "configure:8476: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:8433: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8488: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -8450,12 +8505,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:8454: checking for alloca" >&5 +echo "configure:8509: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+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${ac_exeext}; then +if { (eval echo configure:8542: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -8515,12 +8570,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:8519: checking whether alloca needs Cray hooks" >&5 +echo "configure:8574: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:8549: checking for $ac_func" >&5 +echo "configure:8604: 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${ac_exeext}; then +if { (eval echo configure:8632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -8600,7 +8655,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:8604: checking stack direction for C alloca" >&5 +echo "configure:8659: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8608,7 +8663,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -8650,7 +8705,7 @@ fi # getmntent is in -lsun on Irix 4, -lseq on Dynix/PTX, -lgen on Unixware. echo $ac_n "checking for getmntent in -lsun""... $ac_c" 1>&6 -echo "configure:8654: checking for getmntent in -lsun" >&5 +echo "configure:8709: checking for getmntent in -lsun" >&5 ac_lib_var=`echo sun'_'getmntent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8658,7 +8713,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsun $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8728: \"$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 @@ -8688,7 +8743,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for getmntent in -lseq""... $ac_c" 1>&6 -echo "configure:8692: checking for getmntent in -lseq" >&5 +echo "configure:8747: checking for getmntent in -lseq" >&5 ac_lib_var=`echo seq'_'getmntent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8696,7 +8751,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lseq $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8766: \"$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 @@ -8726,7 +8781,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for getmntent in -lgen""... $ac_c" 1>&6 -echo "configure:8730: checking for getmntent in -lgen" >&5 +echo "configure:8785: checking for getmntent in -lgen" >&5 ac_lib_var=`echo gen'_'getmntent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8734,7 +8789,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgen $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8804: \"$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 @@ -8770,12 +8825,12 @@ fi fi echo $ac_n "checking for getmntent""... $ac_c" 1>&6 -echo "configure:8774: checking for getmntent" >&5 +echo "configure:8829: checking for getmntent" >&5 if eval "test \"`echo '$''{'ac_cv_func_getmntent'+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${ac_exeext}; then +if { (eval echo configure:8857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_getmntent=yes" else @@ -8821,7 +8876,7 @@ else fi echo $ac_n "checking whether closedir returns void""... $ac_c" 1>&6 -echo "configure:8825: checking whether closedir returns void" >&5 +echo "configure:8880: checking whether closedir returns void" >&5 if eval "test \"`echo '$''{'ac_cv_func_closedir_void'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8829,13 +8884,13 @@ else ac_cv_func_closedir_void=yes else cat > conftest.$ac_ext < #include <$ac_header_dirent> int closedir(); main() { exit(closedir(opendir(".")) != 0); } EOF -if { (eval echo configure:8839: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8894: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_closedir_void=no else @@ -8858,7 +8913,7 @@ EOF fi echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6 -echo "configure:8862: checking whether setpgrp takes no argument" >&5 +echo "configure:8917: checking whether setpgrp takes no argument" >&5 if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8866,7 +8921,7 @@ else { echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8945: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_setpgrp_void=no else @@ -8909,7 +8964,7 @@ EOF fi echo $ac_n "checking for working fnmatch""... $ac_c" 1>&6 -echo "configure:8913: checking for working fnmatch" >&5 +echo "configure:8968: checking for working fnmatch" >&5 if eval "test \"`echo '$''{'ac_cv_func_fnmatch_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8920,11 +8975,11 @@ if test "$cross_compiling" = yes; then ac_cv_func_fnmatch_works=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8983: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_fnmatch_works=yes else @@ -8949,7 +9004,7 @@ fi echo $ac_n "checking for setlocale in -lxpg4""... $ac_c" 1>&6 -echo "configure:8953: checking for setlocale in -lxpg4" >&5 +echo "configure:9008: checking for setlocale in -lxpg4" >&5 ac_lib_var=`echo xpg4'_'setlocale | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8957,7 +9012,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lxpg4 $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9027: \"$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 @@ -8991,7 +9046,7 @@ fi echo $ac_n "checking for getpwnam in -lsun""... $ac_c" 1>&6 -echo "configure:8995: checking for getpwnam in -lsun" >&5 +echo "configure:9050: checking for getpwnam in -lsun" >&5 ac_lib_var=`echo sun'_'getpwnam | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8999,7 +9054,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsun $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9069: \"$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 @@ -9042,17 +9097,17 @@ for ac_hdr in zlib.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:9046: checking for $ac_hdr" >&5 +echo "configure:9101: 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:9056: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9111: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -9079,7 +9134,7 @@ fi done echo $ac_n "checking for deflate in -lz""... $ac_c" 1>&6 -echo "configure:9083: checking for deflate in -lz" >&5 +echo "configure:9138: checking for deflate in -lz" >&5 ac_lib_var=`echo z'_'deflate | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -9087,7 +9142,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lz $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9157: \"$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 @@ -9129,7 +9184,7 @@ fi PTHREAD_LIB="" echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 -echo "configure:9133: checking for pthread_create in -lpthread" >&5 +echo "configure:9188: checking for pthread_create in -lpthread" >&5 ac_lib_var=`echo pthread'_'pthread_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 @@ -9137,7 +9192,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9207: \"$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 @@ -9167,7 +9222,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6 -echo "configure:9171: checking for pthread_create in -lpthreads" >&5 +echo "configure:9226: checking for pthread_create in -lpthreads" >&5 ac_lib_var=`echo pthreads'_'pthread_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 @@ -9175,7 +9230,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthreads $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9245: \"$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 @@ -9205,7 +9260,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6 -echo "configure:9209: checking for pthread_create in -lc_r" >&5 +echo "configure:9264: checking for pthread_create in -lc_r" >&5 ac_lib_var=`echo c_r'_'pthread_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 @@ -9213,7 +9268,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lc_r $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9283: \"$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 @@ -9243,12 +9298,12 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create""... $ac_c" 1>&6 -echo "configure:9247: checking for pthread_create" >&5 +echo "configure:9302: checking for pthread_create" >&5 if eval "test \"`echo '$''{'ac_cv_func_pthread_create'+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${ac_exeext}; then +if { (eval echo configure:9330: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_pthread_create=yes" else diff --git a/bacula/kernstodo b/bacula/kernstodo index 76fa0aec68..491d1fa5e5 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -18,9 +18,7 @@ Testing to do: (painful) For 1.30 release: - Fix Bare Metal restore problem. -- Possibly implement a Slot priority (loaded/not loaded). - Test multiple simultaneous Volumes -- Implement run at "xxx" - Document new transparent Console commands and wait command. - Document new immediate File save configuration (walk user @@ -35,10 +33,12 @@ For 1.30 release: - Document logrotate - Document default file backup - Document . command +- Document run when. - Figure out how to use ssh or stunnel to protect Bacula communications. After 1.30: +- Implement a Slot priority (loaded/not loaded). - Implement Automatic Mount even in operator wait. - Implement create "FileSet"? - Implement Release Device in the Job resource to unmount a drive. @@ -972,3 +972,6 @@ rufus-dir: Volume used once. Marking Volume "File0003" as Used. the binary gets deleted when the daemon is stopped in the rc.d/inid.d directory. - Do not ignore SIGCHLD +- Add Cleaning to list of volume statuses +- Implement run at "xxx" + diff --git a/bacula/src/dird/job.c b/bacula/src/dird/job.c index c1800a485d..a1339242f1 100644 --- a/bacula/src/dird/job.c +++ b/bacula/src/dird/job.c @@ -104,8 +104,8 @@ void run_job(JCR *jcr) jcr->jr.Type = jcr->JobType; jcr->jr.Level = jcr->JobLevel; jcr->jr.JobStatus = jcr->JobStatus; - strcpy(jcr->jr.Name, jcr->job->hdr.name); - strcpy(jcr->jr.Job, jcr->Job); + bstrncpy(jcr->jr.Name, jcr->job->hdr.name, sizeof(jcr->jr.Name)); + bstrncpy(jcr->jr.Job, jcr->Job, sizeof(jcr->jr.Job)); /* Initialize termination condition variable */ if ((errstat = pthread_cond_init(&jcr->term_wait, NULL)) != 0) { @@ -268,9 +268,21 @@ bail_out: */ static int acquire_resource_locks(JCR *jcr) { + time_t now = time(NULL); + + /* Wait until scheduled time arrives */ + while (jcr->sched_time > now) { + Dmsg2(100, "Waiting on sched time, jobid=%d secs=%d\n", jcr->JobId, + jcr->sched_time - now); + bmicrosleep(jcr->sched_time - now, 0); + now = time(NULL); + } + + #ifdef USE_SEMAPHORE int stat; + /* Initialize semaphores */ if (jcr->store->sem.valid != SEMLOCK_VALID) { if ((stat = sem_init(&jcr->store->sem, jcr->store->MaxConcurrentJobs)) != 0) { Emsg1(M_ABORT, 0, _("Could not init Storage semaphore: ERR=%s\n"), strerror(stat)); @@ -472,7 +484,7 @@ void create_unique_job_name(JCR *jcr, char *base_name) P(mutex); /* lock creation of jobs */ now = time(NULL); while (now == last_start_time) { - sleep(1); + bmicrosleep(0, 500000); now = time(NULL); } last_start_time = now; diff --git a/bacula/src/dird/scheduler.c b/bacula/src/dird/scheduler.c index 3502d79acd..9ab02e14ef 100644 --- a/bacula/src/dird/scheduler.c +++ b/bacula/src/dird/scheduler.c @@ -95,7 +95,7 @@ JCR *wait_for_next_job(char *job_to_run) if (rem_runjobs > 0) { break; } - sleep(60); + bmicrosleep(60, 0); /* recheck once per minute */ } /* @@ -128,14 +128,13 @@ JCR *wait_for_next_job(char *job_to_run) /* Now wait for the time to run the job */ for (;;) { - int twait; - time(&now); + time_t twait; + now = time(NULL); twait = nexttime - now; - if (twait <= 0) /* time to run it */ + if (twait <= 0) { /* time to run it */ break; - if (twait > 1) /* sleep max 20 seconds */ - twait--; - sleep(twait); + } + bmicrosleep(twait, 0); } run = runjobs[jobindex].run; job = runjobs[jobindex].job; diff --git a/bacula/src/dird/ua_cmds.c b/bacula/src/dird/ua_cmds.c index 74f0600322..e7dfa8a644 100644 --- a/bacula/src/dird/ua_cmds.c +++ b/bacula/src/dird/ua_cmds.c @@ -683,6 +683,7 @@ static int update_volume(UAContext *ua) add_prompt(ua, "Disabled"); add_prompt(ua, "Full"); add_prompt(ua, "Used"); + add_prompt(ua, "Cleaning"); if (strcmp(mr.VolStatus, "Purged") == 0) { add_prompt(ua, "Recycle"); } @@ -1391,7 +1392,7 @@ int quitcmd(UAContext *ua, char *cmd) */ int waitcmd(UAContext *ua, char *cmd) { - usleep(500000); + bmicrosleep(0, 200000); /* let job actually start */ for (int running=1; running; ) { running = 0; lock_jcr_chain(); @@ -1405,7 +1406,7 @@ int waitcmd(UAContext *ua, char *cmd) } unlock_jcr_chain(); if (running) { - sleep(1); + bmicrosleep(1, 0); } } return 1; diff --git a/bacula/src/dird/ua_run.c b/bacula/src/dird/ua_run.c index 7e085d3e5b..0293137421 100644 --- a/bacula/src/dird/ua_run.c +++ b/bacula/src/dird/ua_run.c @@ -50,6 +50,7 @@ int runcmd(UAContext *ua, char *cmd) JCR *jcr; char *job_name, *level_name, *jid, *store_name, *pool_name; char *where, *fileset_name, *client_name, *bootstrap, *replace; + char *when; int i, j, found, opt; JOB *job = NULL; STORE *store = NULL; @@ -67,6 +68,7 @@ int runcmd(UAContext *ua, char *cmd) N_("where"), N_("bootstrap"), N_("replace"), + N_("when"), NULL}; if (!open_db(ua)) { @@ -79,6 +81,7 @@ int runcmd(UAContext *ua, char *cmd) store_name = NULL; pool_name = NULL; where = NULL; + when = NULL; client_name = NULL; fileset_name = NULL; bootstrap = NULL; @@ -175,6 +178,14 @@ int runcmd(UAContext *ua, char *cmd) replace = ua->argv[i]; found = True; break; + case 10: /* When */ + if (when) { + bsendmsg(ua, _("When specified twice.\n")); + return 1; + } + when = ua->argv[i]; + found = True; + break; default: break; } @@ -282,6 +293,15 @@ int runcmd(UAContext *ua, char *cmd) } jcr->RestoreWhere = bstrdup(where); } + + if (when) { + jcr->sched_time = str_to_utime(when); + if (jcr->sched_time == 0) { + bsendmsg(ua, _("Invalid time, using current time.\n")); + jcr->sched_time = time(NULL); + } + } + if (bootstrap) { if (jcr->RestoreBootstrap) { free(jcr->RestoreBootstrap); @@ -316,18 +336,20 @@ try_again: Dmsg1(20, "JobType=%c\n", jcr->JobType); switch (jcr->JobType) { char ec1[30]; + char dt[MAX_TIME_LENGTH]; case JT_ADMIN: bsendmsg(ua, _("Run %s job\n\ JobName: %s\n\ FileSet: %s\n\ Client: %s\n\ -Storage: %s\n"), +Storage: %s\n\ +When: %s\n"), _("Admin"), job->hdr.name, jcr->fileset->hdr.name, NPRT(jcr->client->hdr.name), - NPRT(jcr->store->hdr.name)); - break; + NPRT(jcr->store->hdr.name), + bstrutime(dt, sizeof(dt), jcr->sched_time)); break; case JT_BACKUP: case JT_VERIFY: @@ -354,14 +376,16 @@ FileSet: %s\n\ Level: %s\n\ Client: %s\n\ Storage: %s\n\ -Pool: %s\n"), +Pool: %s\n\ +When: %s\n"), jcr->JobType==JT_BACKUP?_("Backup"):_("Verify"), job->hdr.name, jcr->fileset->hdr.name, level_to_str(jcr->JobLevel), jcr->client->hdr.name, jcr->store->hdr.name, - NPRT(jcr->pool->hdr.name)); + NPRT(jcr->pool->hdr.name), + bstrutime(dt, sizeof(dt), jcr->sched_time)); break; case JT_RESTORE: if (jcr->RestoreJobId == 0 && !jcr->RestoreBootstrap) { @@ -385,7 +409,8 @@ Replace: %s\n\ FileSet: %s\n\ Client: %s\n\ Storage: %s\n\ -JobId: %s\n"), +JobId: %s\n\ +When: %s\n"), job->hdr.name, NPRT(jcr->RestoreBootstrap), jcr->RestoreWhere?jcr->RestoreWhere:NPRT(job->RestoreWhere), @@ -393,7 +418,8 @@ JobId: %s\n"), jcr->fileset->hdr.name, jcr->client->hdr.name, jcr->store->hdr.name, - jcr->RestoreJobId==0?"*None*":edit_uint64(jcr->RestoreJobId, ec1)); + jcr->RestoreJobId==0?"*None*":edit_uint64(jcr->RestoreJobId, ec1), + bstrutime(dt, sizeof(dt), jcr->sched_time)); break; default: bsendmsg(ua, _("Unknown Job Type=%d\n"), jcr->JobType); @@ -407,7 +433,7 @@ JobId: %s\n"), /* * At user request modify parameters of job to be run. */ - if (strlen(ua->cmd) == 0) { + if (ua->cmd[0] == 0) { bsendmsg(ua, _("Job not run.\n")); free_jcr(jcr); return 0; /* do not run */ @@ -421,14 +447,15 @@ JobId: %s\n"), add_prompt(ua, _("Job")); /* 2 */ add_prompt(ua, _("FileSet")); /* 3 */ add_prompt(ua, _("Client")); /* 4 */ + add_prompt(ua, _("When")); /* 5 */ if (jcr->JobType == JT_BACKUP || jcr->JobType == JT_VERIFY) { - add_prompt(ua, _("Pool")); /* 5 */ + add_prompt(ua, _("Pool")); /* 6 */ } else if (jcr->JobType == JT_RESTORE) { - add_prompt(ua, _("Bootstrap")); /* 5 */ - add_prompt(ua, _("Where")); /* 6 */ - add_prompt(ua, _("Replace")); /* 7 */ - add_prompt(ua, _("JobId")); /* 8 */ + add_prompt(ua, _("Bootstrap")); /* 6 */ + add_prompt(ua, _("Where")); /* 7 */ + add_prompt(ua, _("Replace")); /* 8 */ + add_prompt(ua, _("JobId")); /* 9 */ } switch (do_prompt(ua, _("Select parameter to modify"), NULL, 0)) { case 0: @@ -484,6 +511,7 @@ JobId: %s\n"), } goto try_again; case 1: + /* Storage */ store = select_storage_resource(ua); if (store) { jcr->store = store; @@ -508,6 +536,7 @@ JobId: %s\n"), } break; case 4: + /* Client */ client = select_client_resource(ua); if (client) { jcr->client = client; @@ -515,6 +544,21 @@ JobId: %s\n"), } break; case 5: + /* When */ + if (!get_cmd(ua, _("Please enter scheduled start time (return for now): "))) { + break; + } + if (ua->cmd[0] == 0) { + jcr->sched_time = time(NULL); + } else { + jcr->sched_time = str_to_utime(ua->cmd); + if (jcr->sched_time == 0) { + bsendmsg(ua, _("Invalid time, using current time.\n")); + jcr->sched_time = time(NULL); + } + } + goto try_again; + case 6: if (jcr->JobType == JT_BACKUP || jcr->JobType == JT_VERIFY) { /* Pool */ pool = select_pool_resource(ua); @@ -546,7 +590,7 @@ JobId: %s\n"), } } goto try_again; - case 6: + case 7: /* Where */ if (!get_cmd(ua, _("Please enter path prefix for restore (/ for none): "))) { break; @@ -560,7 +604,7 @@ JobId: %s\n"), } jcr->RestoreWhere = bstrdup(ua->cmd); goto try_again; - case 7: + case 8: /* Replace */ start_prompt(ua, _("Replace:\n")); for (i=0; ReplaceOptions[i].name; i++) { @@ -571,7 +615,7 @@ JobId: %s\n"), jcr->replace = ReplaceOptions[opt].token; } goto try_again; - case 8: + case 9: /* JobId */ jid = NULL; /* force reprompt */ jcr->RestoreJobId = 0; diff --git a/bacula/src/filed/authenticate.c b/bacula/src/filed/authenticate.c index cc9d23f12d..6d60323d58 100644 --- a/bacula/src/filed/authenticate.c +++ b/bacula/src/filed/authenticate.c @@ -99,7 +99,7 @@ int authenticate_director(JCR *jcr) if (!authenticate(R_DIRECTOR, dir)) { bnet_fsend(dir, "%s", Dir_sorry); Emsg0(M_FATAL, 0, _("Unable to authenticate Director\n")); - sleep(5); + bmicrosleep(5, 0); return 0; } return bnet_fsend(dir, "%s", OK_hello); diff --git a/bacula/src/lib/bnet.c b/bacula/src/lib/bnet.c index 4bd77416a0..9db53808e6 100644 --- a/bacula/src/lib/bnet.c +++ b/bacula/src/lib/bnet.c @@ -517,7 +517,7 @@ bnet_connect(void *vjcr, int retry_interval, int max_retry_time, char *name, Jmsg(jcr, M_WARNING, 0, "Could not connect to %s on %s:%d. ERR=%s\n\ Retrying ...\n", name, host, port, strerror(errno)); } - sleep(retry_interval); + bmicrosleep(retry_interval, 0); max_retry_time -= retry_interval; if (max_retry_time <= 0) { Jmsg(jcr, M_FATAL, 0, _("Unable to connect to %s on %s:%d. ERR=%s\n"), diff --git a/bacula/src/lib/bnet_server.c b/bacula/src/lib/bnet_server.c index 9798fb6f7a..ba24a153c1 100644 --- a/bacula/src/lib/bnet_server.c +++ b/bacula/src/lib/bnet_server.c @@ -70,7 +70,7 @@ bnet_thread_server(char *bind_addr, int port, int max_clients, workq_t *client_w tlog = 60; Emsg1(M_ERROR, 0, _("Cannot open stream socket: %s. Retrying ...\n"), strerror(errno)); } - sleep(10); + bmicrosleep(10, 0); } /* @@ -106,7 +106,7 @@ bnet_thread_server(char *bind_addr, int port, int max_clients, workq_t *client_w tlog = 2*60; /* Complain every 2 minutes */ Emsg2(M_WARNING, 0, _("Cannot bind port %d: %s. Retrying ...\n"), port, strerror(errno)); } - sleep(5); + bmicrosleep(5, 0); if (--tmax <= 0) { Emsg2(M_ABORT, 0, _("Cannot bind port %d: %s.\n"), port, strerror(errno)); } @@ -198,7 +198,7 @@ bnet_bind(int port) tlog = 2*60; Emsg1(M_ERROR, 0, _("Cannot open stream socket: %s\n"), strerror(errno)); } - sleep(60); + bmicrosleep(60, 0); } /* @@ -221,7 +221,7 @@ bnet_bind(int port) tlog = 2*60; Emsg2(M_WARNING, 0, _("Cannot bind port %d: %s: retrying ...\n"), port, strerror(errno)); } - sleep(5); + bmicrosleep(5, 0); } listen(sockfd, 1); /* tell system we are ready */ return init_bsock(NULL, sockfd, _("Server socket"), _("client"), port); diff --git a/bacula/src/lib/bpipe.c b/bacula/src/lib/bpipe.c index 7b284c9ce9..975c5f6896 100644 --- a/bacula/src/lib/bpipe.c +++ b/bacula/src/lib/bpipe.c @@ -163,7 +163,7 @@ int close_bpipe(BPIPE *bpipe) break; } if (remaining_wait > 0) { - sleep(1); /* wait one second */ + bmicrosleep(1, 0); /* wait one second */ remaining_wait--; } else { stat = 1; /* set error status */ diff --git a/bacula/src/lib/btime.c b/bacula/src/lib/btime.c index 6bd0e71515..0b4b6df221 100644 --- a/bacula/src/lib/btime.c +++ b/bacula/src/lib/btime.c @@ -41,6 +41,7 @@ #include "bacula.h" #include +/* Formatted time */ void bstrftime(char *dt, int maxlen, utime_t tim) { time_t ttime = tim; @@ -51,6 +52,17 @@ void bstrftime(char *dt, int maxlen, utime_t tim) strftime(dt, maxlen, "%d-%b-%Y %H:%M", &tm); } +/* Unix time to standard time string yyyy-mm-dd hh:mm:ss */ +char *bstrutime(char *dt, int maxlen, utime_t tim) +{ + time_t ttime = tim; + struct tm tm; + localtime_r(&ttime, &tm); + strftime(dt, maxlen, "%Y-%m-%d %H:%M:%S", &tm); + return dt; +} + +/* Convert standard time string yyyy-mm-dd hh:mm:ss to Unix time */ utime_t str_to_utime(char *str) { struct tm tm; @@ -77,6 +89,7 @@ utime_t str_to_utime(char *str) return (utime_t)ttime; } +/* Deprecated. Do not use. */ void get_current_time(struct date_time *dt) { struct tm tm; @@ -126,6 +139,7 @@ utime_t btime_to_utime(btime_t bt) /* date_encode -- Encode civil date as a Julian day number. */ +/* Deprecated. Do not use. */ fdate_t date_encode(uint32_t year, uint8_t month, uint8_t day) { @@ -162,6 +176,7 @@ fdate_t date_encode(uint32_t year, uint8_t month, uint8_t day) /* time_encode -- Encode time from hours, minutes, and seconds into a fraction of a day. */ +/* Deprecated. Do not use. */ ftime_t time_encode(uint8_t hour, uint8_t minute, uint8_t second, float32_t second_fraction) { @@ -173,6 +188,7 @@ ftime_t time_encode(uint8_t hour, uint8_t minute, uint8_t second, /* date_time_encode -- Set day number and fraction from date and time. */ +/* Deprecated. Do not use. */ void date_time_encode(struct date_time *dt, uint32_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second, @@ -184,6 +200,7 @@ void date_time_encode(struct date_time *dt, /* date_decode -- Decode a Julian day number into civil date. */ +/* Deprecated. Do not use. */ void date_decode(fdate_t date, uint32_t *year, uint8_t *month, uint8_t *day) { @@ -212,6 +229,7 @@ void date_decode(fdate_t date, uint32_t *year, uint8_t *month, /* time_decode -- Decode a day fraction into civil time. */ +/* Deprecated. Do not use. */ void time_decode(ftime_t time, uint8_t *hour, uint8_t *minute, uint8_t *second, float32_t *second_fraction) { @@ -229,6 +247,7 @@ void time_decode(ftime_t time, uint8_t *hour, uint8_t *minute, /* date_time_decode -- Decode a Julian day and day fraction into civil date and time. */ +/* Deprecated. Do not use. */ void date_time_decode(struct date_time *dt, uint32_t *year, uint8_t *month, uint8_t *day, uint8_t *hour, uint8_t *minute, uint8_t *second, @@ -242,6 +261,7 @@ void date_time_decode(struct date_time *dt, * to a Julian day and day fraction. */ +/* Deprecated. Do not use. */ void tm_encode(struct date_time *dt, struct tm *tm) { @@ -262,6 +282,7 @@ void tm_encode(struct date_time *dt, /* tm_decode -- Decode a Julian day and day fraction into civil date and time in tm structure */ +/* Deprecated. Do not use. */ void tm_decode(struct date_time *dt, struct tm *tm) { @@ -287,6 +308,7 @@ void tm_decode(struct date_time *dt, 1 dt1 > dt2 */ +/* Deprecated. Do not use. */ int date_time_compare(struct date_time *dt1, struct date_time *dt2) { if (dt1->julian_day_number == dt2->julian_day_number) { diff --git a/bacula/src/lib/btime.h b/bacula/src/lib/btime.h index 1026777590..00f9be3edb 100644 --- a/bacula/src/lib/btime.h +++ b/bacula/src/lib/btime.h @@ -1,6 +1,9 @@ /* + See btime.c for defintions. + + The following is deprecated: Time and date structures and functions. Date and time are always represented internally as 64 bit floating point Julian day numbers and @@ -42,57 +45,58 @@ extern time_t btime_to_unix(btime_t bt); /* bacula time to epoch time */ extern utime_t btime_to_utime(btime_t bt); /* bacula time to utime_t */ extern void bstrftime(char *dt, int maxlen, utime_t tim); +extern char *bstrutime(char *dt, int maxlen, utime_t tim); +extern utime_t str_to_utime(char *str); /* =========================================================== */ -/* old code deprecated below. Do not use. */ +/* old code deprecated below. Do not use. */ -typedef float64_t fdate_t; /* Date type */ -typedef float64_t ftime_t; /* Time type */ +typedef float64_t fdate_t; /* Date type */ +typedef float64_t ftime_t; /* Time type */ struct date_time { - fdate_t julian_day_number; /* Julian day number */ + fdate_t julian_day_number; /* Julian day number */ ftime_t julian_day_fraction; /* Julian day fraction */ }; /* In arguments and results of the following functions, quantities are expressed as follows. - year Year in the Common Era. The canonical - date of adoption of the Gregorian calendar - (October 5, 1582 in the Julian calendar) - is assumed. + year Year in the Common Era. The canonical + date of adoption of the Gregorian calendar + (October 5, 1582 in the Julian calendar) + is assumed. - month Month index with January 0, December 11. + month Month index with January 0, December 11. - day Day number of month, 1 to 31. + day Day number of month, 1 to 31. */ extern fdate_t date_encode(uint32_t year, uint8_t month, uint8_t day); extern ftime_t time_encode(uint8_t hour, uint8_t minute, uint8_t second, - float32_t second_fraction); + float32_t second_fraction); extern void date_time_encode(struct date_time *dt, - uint32_t year, uint8_t month, uint8_t day, - uint8_t hour, uint8_t minute, uint8_t second, - float32_t second_fraction); + uint32_t year, uint8_t month, uint8_t day, + uint8_t hour, uint8_t minute, uint8_t second, + float32_t second_fraction); extern void date_decode(fdate_t date, uint32_t *year, uint8_t *month, - uint8_t *day); + uint8_t *day); extern void time_decode(ftime_t time, uint8_t *hour, uint8_t *minute, - uint8_t *second, float32_t *second_fraction); + uint8_t *second, float32_t *second_fraction); extern void date_time_decode(struct date_time *dt, - uint32_t *year, uint8_t *month, uint8_t *day, - uint8_t *hour, uint8_t *minute, uint8_t *second, - float32_t *second_fraction); + uint32_t *year, uint8_t *month, uint8_t *day, + uint8_t *hour, uint8_t *minute, uint8_t *second, + float32_t *second_fraction); extern int date_time_compare(struct date_time *dt1, struct date_time *dt2); extern void tm_encode(struct date_time *dt, struct tm *tm); extern void tm_decode(struct date_time *dt, struct tm *tm); extern void get_current_time(struct date_time *dt); -extern utime_t str_to_utime(char *str); #endif /* __btime_INCLUDED */ diff --git a/bacula/src/lib/cram-md5.c b/bacula/src/lib/cram-md5.c index ec9a05572e..ef64ff15e4 100644 --- a/bacula/src/lib/cram-md5.c +++ b/bacula/src/lib/cram-md5.c @@ -53,7 +53,7 @@ int cram_md5_auth(BSOCK *bs, char *password) } Dmsg1(99, "%s", bs->msg); if (bnet_wait_data(bs, 180) <= 0 || bnet_recv(bs) <= 0) { - sleep(5); + bmicrosleep(5, 0); return 0; } hmac_md5((uint8_t *)chal, strlen(chal), (uint8_t *)password, strlen(password), hmac); @@ -70,7 +70,7 @@ int cram_md5_auth(BSOCK *bs, char *password) bnet_fsend(bs, "1000 OK auth\n"); } else { bnet_fsend(bs, "1999 No auth\n"); - sleep(5); + bmicrosleep(5, 0); } return ok; } @@ -82,12 +82,12 @@ int cram_md5_get_auth(BSOCK *bs, char *password) uint8_t hmac[20]; if (bnet_recv(bs) <= 0) { - sleep(5); + bmicrosleep(5, 0); return 0; } if (bs->msglen >= MAXSTRING || sscanf(bs->msg, "auth cram-md5 %s\n", chal) != 1) { Dmsg1(99, "Wanted auth cram... Got: %s", bs->msg); - sleep(5); + bmicrosleep(5, 0); return 0; } hmac_md5((uint8_t *)chal, strlen(chal), (uint8_t *)password, strlen(password), hmac); @@ -97,12 +97,12 @@ int cram_md5_get_auth(BSOCK *bs, char *password) } Dmsg1(99, "sending resp to challenge: %s\n", bs->msg); if (bnet_wait_data(bs, 180) <= 0 || bnet_recv(bs) <= 0) { - sleep(5); + bmicrosleep(5, 0); return 0; } if (strcmp(bs->msg, "1000 OK auth\n") == 0) { return 1; } - sleep(5); + bmicrosleep(5, 0); return 0; } diff --git a/bacula/src/lib/protos.h b/bacula/src/lib/protos.h index 3b195b034b..4e0abd6dbb 100644 --- a/bacula/src/lib/protos.h +++ b/bacula/src/lib/protos.h @@ -24,137 +24,138 @@ */ /* base64.c */ -void base64_init (void); -int to_base64 (intmax_t value, char *where); -int from_base64 (intmax_t *value, char *where); -int bin_to_base64 (char *buf, char *bin, int len); +void base64_init (void); +int to_base64 (intmax_t value, char *where); +int from_base64 (intmax_t *value, char *where); +int bin_to_base64 (char *buf, char *bin, int len); /* bmisc.c */ -char *bstrncpy (char *dest, const char *src, int maxlen); -char *bstrncat (char *dest, const char *src, int maxlen); -void *b_malloc (char *file, int line, size_t size); +char *bstrncpy (char *dest, const char *src, int maxlen); +char *bstrncat (char *dest, const char *src, int maxlen); +void *b_malloc (char *file, int line, size_t size); #ifndef DEBUG -void *bmalloc (size_t size); +void *bmalloc (size_t size); #endif -void *brealloc (void *buf, size_t size); -void *bcalloc (size_t size1, size_t size2); -int bsnprintf (char *str, size_t size, const char *format, ...); -int bvsnprintf (char *str, size_t size, const char *format, va_list ap); -int pool_sprintf (char *pool_buf, char *fmt, ...); -void create_pid_file (char *dir, char *progname, int port); -int delete_pid_file (char *dir, char *progname, int port); -void drop (char *uid, char *gid); +void *brealloc (void *buf, size_t size); +void *bcalloc (size_t size1, size_t size2); +int bsnprintf (char *str, size_t size, const char *format, ...); +int bvsnprintf (char *str, size_t size, const char *format, va_list ap); +int pool_sprintf (char *pool_buf, char *fmt, ...); +void create_pid_file (char *dir, char *progname, int port); +int delete_pid_file (char *dir, char *progname, int port); +void drop (char *uid, char *gid); +int bmicrosleep (time_t sec, long msec); /* bnet.c */ -int32_t bnet_recv (BSOCK *bsock); -int bnet_send (BSOCK *bsock); -int bnet_fsend (BSOCK *bs, char *fmt, ...); -int bnet_set_buffer_size (BSOCK *bs, uint32_t size, int rw); -int bnet_sig (BSOCK *bs, int sig); -BSOCK * bnet_connect (void *jcr, int retry_interval, - int max_retry_time, char *name, char *host, char *service, - int port, int verbose); -int bnet_wait_data (BSOCK *bsock, int sec); -void bnet_close (BSOCK *bsock); -BSOCK * init_bsock (void *jcr, int sockfd, char *who, char *ip, int port); -BSOCK * dup_bsock (BSOCK *bsock); -void term_bsock (BSOCK *bsock); -char * bnet_strerror (BSOCK *bsock); -char * bnet_sig_to_ascii (BSOCK *bsock); -int bnet_wait_data (BSOCK *bsock, int sec); -int bnet_despool (BSOCK *bsock); -int is_bnet_stop (BSOCK *bsock); -int is_bnet_error (BSOCK *bsock); -void bnet_suppress_error_messages(BSOCK *bsock, int flag); +int32_t bnet_recv (BSOCK *bsock); +int bnet_send (BSOCK *bsock); +int bnet_fsend (BSOCK *bs, char *fmt, ...); +int bnet_set_buffer_size (BSOCK *bs, uint32_t size, int rw); +int bnet_sig (BSOCK *bs, int sig); +BSOCK * bnet_connect (void *jcr, int retry_interval, + int max_retry_time, char *name, char *host, char *service, + int port, int verbose); +int bnet_wait_data (BSOCK *bsock, int sec); +void bnet_close (BSOCK *bsock); +BSOCK * init_bsock (void *jcr, int sockfd, char *who, char *ip, int port); +BSOCK * dup_bsock (BSOCK *bsock); +void term_bsock (BSOCK *bsock); +char * bnet_strerror (BSOCK *bsock); +char * bnet_sig_to_ascii (BSOCK *bsock); +int bnet_wait_data (BSOCK *bsock, int sec); +int bnet_despool (BSOCK *bsock); +int is_bnet_stop (BSOCK *bsock); +int is_bnet_error (BSOCK *bsock); +void bnet_suppress_error_messages(BSOCK *bsock, int flag); /* cram-md5.c */ int cram_md5_get_auth(BSOCK *bs, char *password); int cram_md5_auth(BSOCK *bs, char *password); void hmac_md5(uint8_t* text, int text_len, uint8_t* key, - int key_len, uint8_t *hmac); + int key_len, uint8_t *hmac); /* crc32.c */ uint32_t bcrc32(uint8_t *buf, int len); /* daemon.c */ -void daemon_start (); +void daemon_start (); /* edit.c */ -uint64_t str_to_uint64(char *str); -int64_t str_to_int64(char *str); -char * edit_uint64_with_commas (uint64_t val, char *buf); -char * add_commas (char *val, char *buf); -char * edit_uint64 (uint64_t val, char *buf); -int duration_to_utime (char *str, utime_t *value); -int size_to_uint64(char *str, int str_len, uint64_t *rtn_value); -char *edit_utime (utime_t val, char *buf); -int is_a_number (const char *num); -int is_an_integer (const char *n); +uint64_t str_to_uint64(char *str); +int64_t str_to_int64(char *str); +char * edit_uint64_with_commas (uint64_t val, char *buf); +char * add_commas (char *val, char *buf); +char * edit_uint64 (uint64_t val, char *buf); +int duration_to_utime (char *str, utime_t *value); +int size_to_uint64(char *str, int str_len, uint64_t *rtn_value); +char *edit_utime (utime_t val, char *buf); +int is_a_number (const char *num); +int is_an_integer (const char *n); /* lex.c */ -LEX * lex_close_file (LEX *lf); -LEX * lex_open_file (LEX *lf, char *fname, LEX_ERROR_HANDLER *scan_error); -int lex_get_char (LEX *lf); -void lex_unget_char (LEX *lf); -char * lex_tok_to_str (int token); -int lex_get_token (LEX *lf, int expect); +LEX * lex_close_file (LEX *lf); +LEX * lex_open_file (LEX *lf, char *fname, LEX_ERROR_HANDLER *scan_error); +int lex_get_char (LEX *lf); +void lex_unget_char (LEX *lf); +char * lex_tok_to_str (int token); +int lex_get_token (LEX *lf, int expect); /* message.c */ -void my_name_is (int argc, char *argv[], char *name); -void init_msg (void *jcr, MSGS *msg); -void term_msg (void); -void close_msg (void *jcr); -void add_msg_dest (MSGS *msg, int dest, int type, char *where, char *dest_code); -void rem_msg_dest (MSGS *msg, int dest, int type, char *where); -void Jmsg (void *jcr, int type, int level, char *fmt, ...); -void dispatch_message (void *jcr, int type, int level, char *buf); -void init_console_msg (char *wd); -void free_msgs_res (MSGS *msgs); -int open_spool_file (void *jcr, BSOCK *bs); -int close_spool_file (void *vjcr, BSOCK *bs); +void my_name_is (int argc, char *argv[], char *name); +void init_msg (void *jcr, MSGS *msg); +void term_msg (void); +void close_msg (void *jcr); +void add_msg_dest (MSGS *msg, int dest, int type, char *where, char *dest_code); +void rem_msg_dest (MSGS *msg, int dest, int type, char *where); +void Jmsg (void *jcr, int type, int level, char *fmt, ...); +void dispatch_message (void *jcr, int type, int level, char *buf); +void init_console_msg (char *wd); +void free_msgs_res (MSGS *msgs); +int open_spool_file (void *jcr, BSOCK *bs); +int close_spool_file (void *vjcr, BSOCK *bs); /* bnet_server.c */ -void bnet_thread_server(char *bind_addr, int port, int max_clients, workq_t *client_wq, - void *handle_client_request(void *bsock)); -void bnet_server (int port, void handle_client_request(BSOCK *bsock)); -int net_connect (int port); -BSOCK * bnet_bind (int port); -BSOCK * bnet_accept (BSOCK *bsock, char *who); +void bnet_thread_server(char *bind_addr, int port, int max_clients, workq_t *client_wq, + void *handle_client_request(void *bsock)); +void bnet_server (int port, void handle_client_request(BSOCK *bsock)); +int net_connect (int port); +BSOCK * bnet_bind (int port); +BSOCK * bnet_accept (BSOCK *bsock, char *who); /* signal.c */ -void init_signals (void terminate(int sig)); -void init_stack_dump (void); +void init_signals (void terminate(int sig)); +void init_stack_dump (void); /* util.c */ -void lcase (char *str); -void bash_spaces (char *str); -void unbash_spaces (char *str); -void strip_trailing_junk (char *str); -void strip_trailing_slashes (char *dir); -int skip_spaces (char **msg); -int skip_nonspaces (char **msg); -int fstrsch (char *a, char *b); -char * encode_time (time_t time, char *buf); -char * encode_mode (mode_t mode, char *buf); -int do_shell_expansion (char *name); -int is_buf_zero (char *buf, int len); -void jobstatus_to_ascii (int JobStatus, char *msg, int maxlen); -void pm_strcat (POOLMEM **pm, char *str); -void pm_strcpy (POOLMEM **pm, char *str); -int run_program (char *prog, int wait, POOLMEM *results); -char * job_type_to_str (int type); -char * job_status_to_str (int stat); -char * job_level_to_str (int level); -void makeSessionKey (char *key, char *seed, int mode); -BPIPE * open_bpipe(char *prog, int wait, char *mode); -int close_wpipe(BPIPE *bpipe); -int close_bpipe(BPIPE *bpipe); -POOLMEM *edit_job_codes(void *jcr, char *omsg, char *imsg, char *to); +void lcase (char *str); +void bash_spaces (char *str); +void unbash_spaces (char *str); +void strip_trailing_junk (char *str); +void strip_trailing_slashes (char *dir); +int skip_spaces (char **msg); +int skip_nonspaces (char **msg); +int fstrsch (char *a, char *b); +char * encode_time (time_t time, char *buf); +char * encode_mode (mode_t mode, char *buf); +int do_shell_expansion (char *name); +int is_buf_zero (char *buf, int len); +void jobstatus_to_ascii (int JobStatus, char *msg, int maxlen); +void pm_strcat (POOLMEM **pm, char *str); +void pm_strcpy (POOLMEM **pm, char *str); +int run_program (char *prog, int wait, POOLMEM *results); +char * job_type_to_str (int type); +char * job_status_to_str (int stat); +char * job_level_to_str (int level); +void makeSessionKey (char *key, char *seed, int mode); +BPIPE * open_bpipe(char *prog, int wait, char *mode); +int close_wpipe(BPIPE *bpipe); +int close_bpipe(BPIPE *bpipe); +POOLMEM *edit_job_codes(void *jcr, char *omsg, char *imsg, char *to); void parse_command_args(POOLMEM *cmd, POOLMEM *args, int *argc, - char **argk, char **argv); + char **argk, char **argv); char *next_arg(char **s); diff --git a/bacula/src/lib/signal.c b/bacula/src/lib/signal.c index d4eeaec514..e92bf7b2f4 100644 --- a/bacula/src/lib/signal.c +++ b/bacula/src/lib/signal.c @@ -132,7 +132,7 @@ static void signal_handler(int sig) Dmsg0(500, "Done exit_handler\n"); } else { Dmsg0(500, "Doing sleep\n"); - sleep(30); + bmicrosleep(30, 0); } fprintf(stderr, "It looks like the traceback worked ...\n"); } diff --git a/bacula/src/lib/watchdog.c b/bacula/src/lib/watchdog.c index 5f5ac6638b..786c1366a4 100755 --- a/bacula/src/lib/watchdog.c +++ b/bacula/src/lib/watchdog.c @@ -43,8 +43,8 @@ static void stop_btimer(btimer_id wid); static btimer_id btimer_start_common(uint32_t wait); /* Static globals */ -static pthread_mutex_t mutex; -static pthread_cond_t timer; +static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; +static pthread_cond_t timer = PTHREAD_COND_INITIALIZER; static int quit; static btimer_t *timer_chain = NULL; @@ -75,13 +75,6 @@ int start_watchdog(void) sigfillset(&sigtimer.sa_mask); sigaction(TIMEOUT_SIGNAL, &sigtimer, NULL); watchdog_time = time(NULL); - if ((stat = pthread_mutex_init(&mutex, NULL)) != 0) { - return stat; - } - if ((stat = pthread_cond_init(&timer, NULL)) != 0) { - pthread_mutex_destroy(&mutex); - return stat; - } quit = FALSE; if ((stat = pthread_create(&wdid, NULL, btimer_thread, (void *)NULL)) != 0) { pthread_mutex_destroy(&mutex); @@ -117,8 +110,6 @@ int stop_watchdog(void) */ static void *btimer_thread(void *arg) { - struct timespec timeout; - int stat; JCR *jcr; BSOCK *fd; btimer_t *wid; @@ -128,8 +119,6 @@ static void *btimer_thread(void *arg) P(mutex); for ( ;!quit; ) { - struct timeval tv; - struct timezone tz; time_t timer_start, now; Dmsg0(200, "Top of for loop\n"); @@ -182,17 +171,12 @@ static void *btimer_thread(void *arg) } unlock_jcr_chain(); - gettimeofday(&tv, &tz); - timeout.tv_nsec = 0; - timeout.tv_sec = tv.tv_sec + SLEEP_TIME; - - Dmsg1(200, "pthread_cond_timedwait sec=%d\n", timeout.tv_sec); - /* Note, this unlocks mutex during the sleep */ - stat = pthread_cond_timedwait(&timer, &mutex, &timeout); - Dmsg1(200, "pthread_cond_timedwait stat=%d\n", stat); - + bmicrosleep(SLEEP_TIME, 0); now = time(NULL); + /* + * Now handle child and thread timers set by the code. + */ /* Walk child chain killing off any process overdue */ for (wid = timer_chain; wid; wid=wid->next) { int killed = FALSE; @@ -211,7 +195,7 @@ static void *btimer_thread(void *arg) /* If we asked a child to die, wait 3 seconds and slam him */ if (killed) { btimer_t *wid1; - sleep(3); + bmicrosleep(3, 0); for (wid1 = timer_chain; wid1; wid1=wid1->next) { if (wid->type == TYPE_CHILD && !wid1->killed && now > (wid1->start_time + wid1->wait)) { diff --git a/bacula/src/stored/authenticate.c b/bacula/src/stored/authenticate.c index fa9b215497..ec235f0228 100644 --- a/bacula/src/stored/authenticate.c +++ b/bacula/src/stored/authenticate.c @@ -105,7 +105,7 @@ int authenticate_director(JCR *jcr) if (!authenticate(R_DIRECTOR, dir)) { bnet_fsend(dir, "%s", Dir_sorry); Emsg1(M_ERROR, 0, _("Unable to authenticate Director at %s.\n"), dir->who); - sleep(5); + bmicrosleep(5, 0); return 0; } return bnet_fsend(dir, "%s", OK_hello); diff --git a/bacula/src/stored/dev.c b/bacula/src/stored/dev.c index 0b5a831beb..9614061193 100644 --- a/bacula/src/stored/dev.c +++ b/bacula/src/stored/dev.c @@ -258,7 +258,7 @@ open_dev(DEVICE *dev, char *VolName, int mode) } if (errno == EBUSY && timeout-- > 0) { Dmsg2(100, "Device %s busy. ERR=%s\n", dev->dev_name, strerror(errno)); - sleep(1); + bmicrosleep(1, 0); continue; } dev->dev_errno = errno; @@ -357,7 +357,7 @@ int rewind_dev(DEVICE *dev) clrerror_dev(dev, MTREW); if (dev->dev_errno == EIO && i > 0) { Dmsg0(200, "Sleeping 5 seconds.\n"); - sleep(5); + bmicrosleep(5, 0); continue; } Mmsg2(&dev->errmsg, _("Rewind error on %s. ERR=%s.\n"), diff --git a/bacula/src/stored/dircmd.c b/bacula/src/stored/dircmd.c index aa0f57f581..344fdb5108 100644 --- a/bacula/src/stored/dircmd.c +++ b/bacula/src/stored/dircmd.c @@ -371,7 +371,7 @@ static void label_volume_if_ok(JCR *jcr, DEVICE *dev, char *oldname, for ( ; !(dev->state & ST_OPENED); ) { if (open_dev(dev, jcr->VolumeName, READ_WRITE) < 0) { if (dev->dev_errno == EAGAIN || dev->dev_errno == EBUSY) { - sleep(30); + bmicrosleep(30, 0); } bnet_fsend(dir, _("3910 Unable to open device %s. ERR=%s\n"), dev_name(dev), strerror_dev(dev)); diff --git a/bacula/src/stored/stored.c b/bacula/src/stored/stored.c index 8d2868bb7f..1a32be9ac1 100644 --- a/bacula/src/stored/stored.c +++ b/bacula/src/stored/stored.c @@ -215,7 +215,7 @@ int main (int argc, char *argv[]) * Sleep a bit to give device thread a chance to lock the resource * chain before we start the server. */ - sleep(1); + bmicrosleep(1, 0); /* Single server used for Director and File daemon */ bnet_thread_server(me->SDaddr, me->SDport, me->max_concurrent_jobs * 2 + 1, -- 2.39.5