From f1d29fcfc45a093902152d37d453a9482692feda Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Thu, 9 May 2002 05:46:11 +0000 Subject: [PATCH] DB changes for Retention Periods git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@15 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/autoconf/config.h.in | 6 - bacula/autoconf/configure.in | 19 +- bacula/configure | 692 +++++++++++++------------- bacula/src/cats/cats.h | 10 +- bacula/src/cats/drop_mysql_tables.in | 7 +- bacula/src/cats/drop_sqlite_tables.in | 7 + bacula/src/cats/make_mysql_tables.in | 16 +- bacula/src/cats/make_sqlite_tables.in | 28 +- bacula/src/cats/sql.c | 27 +- bacula/src/cats/sql_create.c | 44 +- bacula/src/cats/sql_get.c | 23 +- bacula/src/cats/sql_list.c | 2 +- bacula/src/cats/sql_update.c | 23 +- bacula/src/cats/sqlite.in | 3 +- bacula/src/console/Makefile.in | 2 +- bacula/src/console/console.c | 2 +- bacula/src/dird/dird_conf.c | 16 +- bacula/src/dird/dird_conf.h | 4 +- bacula/src/dird/newvol.c | 26 +- bacula/src/dird/ua_cmds.c | 99 +++- bacula/src/dird/ua_prune.c | 57 +-- bacula/src/lib/Makefile.in | 3 +- bacula/src/lib/jcr.c | 3 +- bacula/src/lib/message.c | 25 +- bacula/src/lib/message.h | 1 + bacula/src/lib/parse_conf.c | 66 +-- bacula/src/lib/protos.h | 166 +++--- bacula/src/lib/util.c | 67 +++ bacula/src/stored/bextract.c | 2 +- bacula/src/stored/bls.c | 2 +- bacula/src/stored/bscan.c | 2 +- bacula/src/stored/btape.c | 2 +- bacula/src/version.h | 4 +- 33 files changed, 785 insertions(+), 671 deletions(-) create mode 100644 bacula/src/cats/drop_sqlite_tables.in diff --git a/bacula/autoconf/config.h.in b/bacula/autoconf/config.h.in index cc1892aabe..66845723ee 100644 --- a/bacula/autoconf/config.h.in +++ b/bacula/autoconf/config.h.in @@ -426,12 +426,6 @@ /* Define if you have the header file. */ #undef HAVE_SYS_TIME_H -/* Define if you have the header file. */ -#undef HAVE_TERMCAP_H - -/* Define if you have the header file. */ -#undef HAVE_TERMIO_H - /* Define if you have the header file. */ #undef HAVE_TERMIOS_H diff --git a/bacula/autoconf/configure.in b/bacula/autoconf/configure.in index 179c880b6b..d49de02a5f 100644 --- a/bacula/autoconf/configure.in +++ b/bacula/autoconf/configure.in @@ -212,7 +212,7 @@ if test x$support_readline = xyes; then AC_CHECK_HEADER($with_readline/readline.h, [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_READLINE) - CONS_LIBS="-lreadline" + CONS_LIBS="-lreadline -ltermcap" got_readline="yes" ], [ AC_MSG_ERROR([*** readline library missing]) @@ -227,14 +227,14 @@ if test x$support_readline = xyes; then AC_DEFINE(HAVE_READLINE) got_readline="yes" CONS_INC="-I/usr/include/readline" - CONS_LIBS="-lreadline" + CONS_LIBS="-lreadline -ltermcap" ], [ # Did not find starndard library, so user our own AC_MSG_RESULT(yes) AC_DEFINE(HAVE_READLINE) got_readline="yes" CONS_INC="-I${TOP_DIR}/depkgs" - CONS_LIBS="-lreadline -lhistory" + CONS_LIBS="-lreadline -lhistory -ltermcap" CONS_LDFLAGS="-L${TOP_DIR}/depkgs/readline" READLINE_SRC="${TOP_DIR}/depkgs/readline" ]) @@ -265,12 +265,7 @@ AC_CHECK_FUNC(getopt_long, AC_DEFINE(HAVE_GETOPT_LONG)) AC_FUNC_STRCOLL AC_CHECK_HEADERS(varargs.h \ - sys/ptem.h sys/pte.h sys/stream.h \ - termcap.h termio.h ) - -TERMCAP_LIB=-ltermcap -AC_SUBST(TERMCAP_LIB) - + sys/ptem.h sys/pte.h sys/stream.h) # End of readline stuff # ----------------------------------------------------------------------- @@ -339,6 +334,7 @@ AC_SUBST(GMP_SRC) # Check for CWEB support/directory # --------------------------------------------------- CWEB_SRC= +CWEB=/bin local_cweb="no" AC_ARG_WITH(cweb, [ --with-cweb[=DIR] Specify cweb library directory], @@ -378,6 +374,7 @@ AC_ARG_WITH(cweb, AC_DEFINE(HAVE_CWEB) got_cweb="yes" local_cweb="yes" + CWEB=${TOP_DIR}/depkgs/cweb CWEB_INC="-I${TOP_DIR}/depkgs/cweb" CWEB_LIBS="-lcweb" CWEB_LDFLAGS="-L${TOP_DIR}/depkgs/cweb" @@ -385,6 +382,7 @@ AC_ARG_WITH(cweb, ]) ] ) +AC_SUBST(CWEB) AC_SUBST(CWEB_INC) AC_SUBST(CWEB_LIBS) AC_SUBST(CWEB_LDFLAGS) @@ -1183,6 +1181,7 @@ AC_OUTPUT([autoconf/Make.common \ src/cats/create_mysql_database \ src/cats/grant_mysql_privileges \ src/cats/make_sqlite_tables \ + src/cats/drop_sqlite_tables \ src/cats/sqlite \ src/findlib/Makefile \ $PFILES ], @@ -1199,7 +1198,7 @@ chmod 755 src/cats/make_mysql_tables src/cats/drop_mysql_tables chmod 755 src/cats/make_test_tables src/cats/drop_test_tables chmod 755 src/cats/create_mysql_database chmod 755 src/cats/grant_mysql_privileges -chmod 755 src/cats/make_sqlite_tables +chmod 755 src/cats/make_sqlite_tables src/cats/drop_sqlite_tables chmod 755 src/cats/sqlite diff --git a/bacula/configure b/bacula/configure index 2707774c10..5268fbf4f6 100755 --- a/bacula/configure +++ b/bacula/configure @@ -2680,7 +2680,7 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then #define HAVE_READLINE 1 EOF - CONS_LIBS="-lreadline" + CONS_LIBS="-lreadline -ltermcap" got_readline="yes" else @@ -2731,7 +2731,7 @@ EOF got_readline="yes" CONS_INC="-I/usr/include/readline" - CONS_LIBS="-lreadline" + CONS_LIBS="-lreadline -ltermcap" else echo "$ac_t""no" 1>&6 @@ -2744,7 +2744,7 @@ EOF got_readline="yes" CONS_INC="-I${TOP_DIR}/depkgs" - CONS_LIBS="-lreadline -lhistory" + CONS_LIBS="-lreadline -lhistory -ltermcap" CONS_LDFLAGS="-L${TOP_DIR}/depkgs/readline" READLINE_SRC="${TOP_DIR}/depkgs/readline" @@ -3102,22 +3102,21 @@ fi for ac_hdr in varargs.h \ - sys/ptem.h sys/pte.h sys/stream.h \ - termcap.h termio.h + sys/ptem.h sys/pte.h sys/stream.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3111: checking for $ac_hdr" >&5 +echo "configure:3110: 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:3121: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3120: \"$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* @@ -3142,11 +3141,7 @@ else echo "$ac_t""no" 1>&6 fi done - - -TERMCAP_LIB=-ltermcap - - + # End of readline stuff # ----------------------------------------------------------------------- @@ -3173,17 +3168,17 @@ if test "${with_gmp+set}" = set; then fi ac_safe=`echo "$with_gmp/gmp.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $with_gmp/gmp.h""... $ac_c" 1>&6 -echo "configure:3177: checking for $with_gmp/gmp.h" >&5 +echo "configure:3172: checking for $with_gmp/gmp.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:3187: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3182: \"$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* @@ -3222,17 +3217,17 @@ else # check for standard gmp library ac_safe=`echo "/usr/include/gmp.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for /usr/include/gmp.h""... $ac_c" 1>&6 -echo "configure:3226: checking for /usr/include/gmp.h" >&5 +echo "configure:3221: checking for /usr/include/gmp.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:3236: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3231: \"$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* @@ -3292,6 +3287,7 @@ fi # Check for CWEB support/directory # --------------------------------------------------- CWEB_SRC= +CWEB=/bin local_cweb="no" # Check whether --with-cweb or --without-cweb was given. if test "${with_cweb+set}" = set; then @@ -3309,17 +3305,17 @@ if test "${with_cweb+set}" = set; then fi ac_safe=`echo "$with_cweb/cweb.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $with_cweb/cweb.h""... $ac_c" 1>&6 -echo "configure:3313: checking for $with_cweb/cweb.h" >&5 +echo "configure:3309: checking for $with_cweb/cweb.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:3323: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3319: \"$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* @@ -3358,17 +3354,17 @@ else # check for standard cweb library ac_safe=`echo "/usr/include/cweb.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for /usr/include/cweb.h""... $ac_c" 1>&6 -echo "configure:3362: checking for /usr/include/cweb.h" >&5 +echo "configure:3358: checking for /usr/include/cweb.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:3372: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3368: \"$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* @@ -3404,6 +3400,7 @@ EOF got_cweb="yes" local_cweb="yes" + CWEB=${TOP_DIR}/depkgs/cweb CWEB_INC="-I${TOP_DIR}/depkgs/cweb" CWEB_LIBS="-lcweb" CWEB_LDFLAGS="-L${TOP_DIR}/depkgs/cweb" @@ -3420,6 +3417,7 @@ fi + # End of CWEB stuff # ----------------------------------------------------------------------- @@ -3437,9 +3435,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:3441: checking for libwrap" >&5 +echo "configure:3439: checking for libwrap" >&5 cat > conftest.$ac_ext < int deny_severity = 0; @@ -3449,7 +3447,7 @@ int main() { hosts_access(req); ; return 0; } EOF -if { (eval echo configure:3453: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6 @@ -3716,7 +3714,7 @@ fi have_db=no db_name=none echo $ac_n "checking for MySQL support""... $ac_c" 1>&6 -echo "configure:3720: checking for MySQL support" >&5 +echo "configure:3718: checking for MySQL support" >&5 # Check whether --with-mysql or --without-mysql was given. if test "${with_mysql+set}" = set; then withval="$with_mysql" @@ -3798,7 +3796,7 @@ fi have_db=no db_name=none echo $ac_n "checking for SQLite support""... $ac_c" 1>&6 -echo "configure:3802: checking for SQLite support" >&5 +echo "configure:3800: checking for SQLite support" >&5 # Check whether --with-sqlite or --without-sqlite was given. if test "${with_sqlite+set}" = set; then withval="$with_sqlite" @@ -3871,19 +3869,19 @@ fi echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:3875: checking for mingw32 environment" >&5 +echo "configure:3873: 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:3885: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -3902,7 +3900,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:3906: checking for executable suffix" >&5 +echo "configure:3904: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3912,7 +3910,7 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:3916: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:3914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj) ;; @@ -3940,7 +3938,7 @@ ac_exeext=$EXEEXT # 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:3944: checking for X" >&5 +echo "configure:3942: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -4002,12 +4000,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:4011: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4009: \"$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* @@ -4076,14 +4074,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:4085: \"$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. @@ -4189,17 +4187,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:4193: checking whether -R must be followed by a space" >&5 +echo "configure:4191: 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:4201: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_R_nospace=yes else @@ -4215,14 +4213,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:4224: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_R_space=yes else @@ -4254,7 +4252,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:4258: checking for dnet_ntoa in -ldnet" >&5 +echo "configure:4256: 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 @@ -4262,7 +4260,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:4275: \"$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 @@ -4295,7 +4293,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:4299: checking for dnet_ntoa in -ldnet_stub" >&5 +echo "configure:4297: 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 @@ -4303,7 +4301,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:4316: \"$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 @@ -4343,12 +4341,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:4347: checking for gethostbyname" >&5 +echo "configure:4345: 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:4373: \"$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 @@ -4392,7 +4390,7 @@ fi if test $ac_cv_func_gethostbyname = no; then echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:4396: checking for gethostbyname in -lnsl" >&5 +echo "configure:4394: 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 @@ -4400,7 +4398,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:4413: \"$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 @@ -4441,12 +4439,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:4445: checking for connect" >&5 +echo "configure:4443: 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:4471: \"$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 @@ -4490,7 +4488,7 @@ fi if test $ac_cv_func_connect = no; then echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6 -echo "configure:4494: checking for connect in -lsocket" >&5 +echo "configure:4492: 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 @@ -4498,7 +4496,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:4511: \"$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 @@ -4533,12 +4531,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:4537: checking for remove" >&5 +echo "configure:4535: 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:4563: \"$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 @@ -4582,7 +4580,7 @@ fi if test $ac_cv_func_remove = no; then echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6 -echo "configure:4586: checking for remove in -lposix" >&5 +echo "configure:4584: 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 @@ -4590,7 +4588,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:4603: \"$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 @@ -4625,12 +4623,12 @@ fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. echo $ac_n "checking for shmat""... $ac_c" 1>&6 -echo "configure:4629: checking for shmat" >&5 +echo "configure:4627: 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:4655: \"$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 @@ -4674,7 +4672,7 @@ fi if test $ac_cv_func_shmat = no; then echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6 -echo "configure:4678: checking for shmat in -lipc" >&5 +echo "configure:4676: 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 @@ -4682,7 +4680,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:4695: \"$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 @@ -4726,7 +4724,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:4730: checking for IceConnectionNumber in -lICE" >&5 +echo "configure:4728: 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 @@ -4734,7 +4732,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:4747: \"$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 @@ -4790,17 +4788,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:4794: checking for $ac_hdr" >&5 +echo "configure:4792: 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:4804: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4802: \"$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* @@ -4827,12 +4825,12 @@ fi done echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:4831: checking for ANSI C header files" >&5 +echo "configure:4829: 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 @@ -4840,7 +4838,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4844: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4842: \"$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* @@ -4857,7 +4855,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 @@ -4875,7 +4873,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 @@ -4896,7 +4894,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -4907,7 +4905,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:4911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4909: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -4931,19 +4929,19 @@ EOF fi echo $ac_n "checking whether sys/types.h defines makedev""... $ac_c" 1>&6 -echo "configure:4935: checking whether sys/types.h defines makedev" >&5 +echo "configure:4933: 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:4947: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4945: \"$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 @@ -4961,17 +4959,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:4965: checking for sys/mkdev.h" >&5 +echo "configure:4963: 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:4975: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4973: \"$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* @@ -4999,17 +4997,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:5003: checking for sys/sysmacros.h" >&5 +echo "configure:5001: 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:5013: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5011: \"$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* @@ -5041,12 +5039,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:5045: checking for $ac_hdr that defines DIR" >&5 +echo "configure:5043: 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> @@ -5054,7 +5052,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:5058: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5056: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -5079,7 +5077,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:5083: checking for opendir in -ldir" >&5 +echo "configure:5081: 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 @@ -5087,7 +5085,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:5100: \"$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 @@ -5120,7 +5118,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:5124: checking for opendir in -lx" >&5 +echo "configure:5122: 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 @@ -5128,7 +5126,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:5141: \"$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 @@ -5162,12 +5160,12 @@ fi fi echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6 -echo "configure:5166: checking whether stat file-mode macros are broken" >&5 +echo "configure:5164: 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 @@ -5218,12 +5216,12 @@ EOF fi echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:5222: checking for sys/wait.h that is POSIX.1 compatible" >&5 +echo "configure:5220: 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 @@ -5239,7 +5237,7 @@ wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:5243: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5241: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else @@ -5260,12 +5258,12 @@ EOF fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:5264: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:5262: 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 @@ -5274,7 +5272,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:5278: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5276: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -5295,12 +5293,12 @@ EOF fi echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6 -echo "configure:5299: checking for st_blksize in struct stat" >&5 +echo "configure:5297: 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 @@ -5308,7 +5306,7 @@ int main() { struct stat s; s.st_blksize; ; return 0; } EOF -if { (eval echo configure:5312: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5310: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_blksize=yes else @@ -5329,12 +5327,12 @@ EOF fi echo $ac_n "checking for st_blocks in struct stat""... $ac_c" 1>&6 -echo "configure:5333: checking for st_blocks in struct stat" >&5 +echo "configure:5331: 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 @@ -5342,7 +5340,7 @@ int main() { struct stat s; s.st_blocks; ; return 0; } EOF -if { (eval echo configure:5346: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5344: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_blocks=yes else @@ -5365,12 +5363,12 @@ else fi echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 -echo "configure:5369: checking whether struct tm is in sys/time.h or time.h" >&5 +echo "configure:5367: 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 @@ -5378,7 +5376,7 @@ int main() { struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:5382: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5380: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -5399,12 +5397,12 @@ EOF fi echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6 -echo "configure:5403: checking for tm_zone in struct tm" >&5 +echo "configure:5401: 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> @@ -5412,7 +5410,7 @@ int main() { struct tm tm; tm.tm_zone; ; return 0; } EOF -if { (eval echo configure:5416: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5414: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm_zone=yes else @@ -5432,12 +5430,12 @@ EOF else echo $ac_n "checking for tzname""... $ac_c" 1>&6 -echo "configure:5436: checking for tzname" >&5 +echo "configure:5434: 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. */ @@ -5447,7 +5445,7 @@ int main() { atoi(*tzname); ; return 0; } EOF -if { (eval echo configure:5451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_var_tzname=yes else @@ -5474,12 +5472,12 @@ fi # be POSIX, POSIX_C, ALL, HPUX or whatever, depending on the machine. echo $ac_n "checking for utime.h""... $ac_c" 1>&6 -echo "configure:5478: checking for utime.h" >&5 +echo "configure:5476: checking for utime.h" >&5 if eval "test \"`echo '$''{'tar_cv_header_utime_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -5488,7 +5486,7 @@ int main() { struct utimbuf foo ; return 0; } EOF -if { (eval echo configure:5492: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5490: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tar_cv_header_utime_h=yes else @@ -5507,12 +5505,12 @@ EOF echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:5511: checking for working const" >&5 +echo "configure:5509: 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:5563: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -5584,17 +5582,17 @@ fi echo $ac_n "checking how to get filesystem type""... $ac_c" 1>&6 -echo "configure:5588: checking how to get filesystem type" >&5 +echo "configure:5586: 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:5598: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5596: \"$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* @@ -5610,13 +5608,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:5620: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5618: \"$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* @@ -5633,13 +5631,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:5643: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5641: \"$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* @@ -5656,12 +5654,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:5665: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5663: \"$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* @@ -5678,7 +5676,7 @@ rm -f conftest* fi if test $fstype = no; then cat > conftest.$ac_ext < EOF @@ -5695,13 +5693,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:5705: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5703: \"$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* @@ -5719,12 +5717,12 @@ fi echo "$ac_t""$fstype" 1>&6 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:5723: checking return type of signal handlers" >&5 +echo "configure:5721: 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 @@ -5741,7 +5739,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:5745: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5743: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -5761,13 +5759,13 @@ EOF echo $ac_n "checking for type of signal functions""... $ac_c" 1>&6 -echo "configure:5765: checking for type of signal functions" >&5 +echo "configure:5763: 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() { @@ -5780,7 +5778,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:5784: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* bash_cv_signal_vintage=posix else @@ -5789,7 +5787,7 @@ else rm -rf conftest* cat > conftest.$ac_ext < int main() { @@ -5799,7 +5797,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:5803: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5801: \"$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 @@ -5808,7 +5806,7 @@ else rm -rf conftest* cat > conftest.$ac_ext < @@ -5821,7 +5819,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:5825: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* bash_cv_signal_vintage=svr3 else @@ -5860,12 +5858,12 @@ EOF fi echo $ac_n "checking for mode_t""... $ac_c" 1>&6 -echo "configure:5864: checking for mode_t" >&5 +echo "configure:5862: 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 @@ -5893,12 +5891,12 @@ EOF fi echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:5897: checking for uid_t in sys/types.h" >&5 +echo "configure:5895: 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 @@ -5927,12 +5925,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:5931: checking for size_t" >&5 +echo "configure:5929: 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 @@ -5960,12 +5958,12 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:5964: checking for pid_t" >&5 +echo "configure:5962: 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 @@ -5993,12 +5991,12 @@ EOF fi echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:5997: checking for off_t" >&5 +echo "configure:5995: 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 @@ -6026,12 +6024,12 @@ EOF fi echo $ac_n "checking for ino_t""... $ac_c" 1>&6 -echo "configure:6030: checking for ino_t" >&5 +echo "configure:6028: 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 @@ -6059,12 +6057,12 @@ EOF fi echo $ac_n "checking for dev_t""... $ac_c" 1>&6 -echo "configure:6063: checking for dev_t" >&5 +echo "configure:6061: 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 @@ -6092,12 +6090,12 @@ EOF fi echo $ac_n "checking for daddr_t""... $ac_c" 1>&6 -echo "configure:6096: checking for daddr_t" >&5 +echo "configure:6094: 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 @@ -6125,12 +6123,12 @@ EOF fi echo $ac_n "checking for major_t""... $ac_c" 1>&6 -echo "configure:6129: checking for major_t" >&5 +echo "configure:6127: 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 @@ -6158,12 +6156,12 @@ EOF fi echo $ac_n "checking for minor_t""... $ac_c" 1>&6 -echo "configure:6162: checking for minor_t" >&5 +echo "configure:6160: 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 @@ -6191,12 +6189,12 @@ EOF fi echo $ac_n "checking for ssize_t""... $ac_c" 1>&6 -echo "configure:6195: checking for ssize_t" >&5 +echo "configure:6193: 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 @@ -6224,12 +6222,12 @@ EOF fi echo $ac_n "checking for st_blocks in struct stat""... $ac_c" 1>&6 -echo "configure:6228: checking for st_blocks in struct stat" >&5 +echo "configure:6226: 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 @@ -6237,7 +6235,7 @@ int main() { struct stat s; s.st_blocks; ; return 0; } EOF -if { (eval echo configure:6241: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6239: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_blocks=yes else @@ -6260,12 +6258,12 @@ else fi echo $ac_n "checking for st_rdev in struct stat""... $ac_c" 1>&6 -echo "configure:6264: checking for st_rdev in struct stat" >&5 +echo "configure:6262: 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 @@ -6273,7 +6271,7 @@ int main() { struct stat s; s.st_rdev; ; return 0; } EOF -if { (eval echo configure:6277: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6275: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_rdev=yes else @@ -6294,12 +6292,12 @@ EOF fi echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 -echo "configure:6298: checking whether struct tm is in sys/time.h or time.h" >&5 +echo "configure:6296: 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 @@ -6307,7 +6305,7 @@ int main() { struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:6311: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6309: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -6328,12 +6326,12 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:6332: checking for working const" >&5 +echo "configure:6330: 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:6384: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -6405,7 +6403,7 @@ fi echo $ac_n "checking size of char""... $ac_c" 1>&6 -echo "configure:6409: checking size of char" >&5 +echo "configure:6407: 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 @@ -6413,7 +6411,7 @@ else ac_cv_sizeof_char=1 else cat > conftest.$ac_ext < main() @@ -6424,7 +6422,7 @@ main() exit(0); } EOF -if { (eval echo configure:6428: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6426: \"$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 @@ -6444,7 +6442,7 @@ EOF echo $ac_n "checking size of short int""... $ac_c" 1>&6 -echo "configure:6448: checking size of short int" >&5 +echo "configure:6446: 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 @@ -6452,7 +6450,7 @@ else ac_cv_sizeof_short_int=2 else cat > conftest.$ac_ext < main() @@ -6463,7 +6461,7 @@ main() exit(0); } EOF -if { (eval echo configure:6467: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6465: \"$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 @@ -6483,7 +6481,7 @@ EOF echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:6487: checking size of int" >&5 +echo "configure:6485: 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 @@ -6491,7 +6489,7 @@ else ac_cv_sizeof_int=4 else cat > conftest.$ac_ext < main() @@ -6502,7 +6500,7 @@ main() exit(0); } EOF -if { (eval echo configure:6506: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6504: \"$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 @@ -6522,7 +6520,7 @@ EOF echo $ac_n "checking size of long int""... $ac_c" 1>&6 -echo "configure:6526: checking size of long int" >&5 +echo "configure:6524: 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 @@ -6530,7 +6528,7 @@ else ac_cv_sizeof_long_int=4 else cat > conftest.$ac_ext < main() @@ -6541,7 +6539,7 @@ main() exit(0); } EOF -if { (eval echo configure:6545: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6543: \"$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 @@ -6561,7 +6559,7 @@ EOF echo $ac_n "checking size of long long int""... $ac_c" 1>&6 -echo "configure:6565: checking size of long long int" >&5 +echo "configure:6563: 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 @@ -6569,7 +6567,7 @@ else ac_cv_sizeof_long_long_int=8 else cat > conftest.$ac_ext < main() @@ -6580,7 +6578,7 @@ main() exit(0); } EOF -if { (eval echo configure:6584: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6582: \"$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 @@ -6600,7 +6598,7 @@ EOF echo $ac_n "checking size of int *""... $ac_c" 1>&6 -echo "configure:6604: checking size of int *" >&5 +echo "configure:6602: 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 @@ -6608,7 +6606,7 @@ else ac_cv_sizeof_int_p=4 else cat > conftest.$ac_ext < main() @@ -6619,7 +6617,7 @@ main() exit(0); } EOF -if { (eval echo configure:6623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6621: \"$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 @@ -6641,20 +6639,20 @@ EOF # Check for sys/types.h types echo $ac_n "checking for u_int type""... $ac_c" 1>&6 -echo "configure:6645: checking for u_int type" >&5 +echo "configure:6643: 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:6658: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6656: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_u_int="yes" else @@ -6678,20 +6676,20 @@ EOF fi echo $ac_n "checking for intmax_t type""... $ac_c" 1>&6 -echo "configure:6682: checking for intmax_t type" >&5 +echo "configure:6680: 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:6695: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6693: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_intmax_t="yes" else @@ -6700,14 +6698,14 @@ else rm -rf conftest* cat > conftest.$ac_ext < int main() { intmax_t a; a = 1; ; return 0; } EOF -if { (eval echo configure:6711: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6709: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_intmax_t="yes" else @@ -6737,20 +6735,20 @@ fi echo $ac_n "checking for u_intmax_t type""... $ac_c" 1>&6 -echo "configure:6741: checking for u_intmax_t type" >&5 +echo "configure:6739: 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:6754: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6752: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_u_intmax_t="yes" else @@ -6759,14 +6757,14 @@ else rm -rf conftest* cat > conftest.$ac_ext < int main() { u_intmax_t a; a = 1; ; return 0; } EOF -if { (eval echo configure:6770: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6768: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_u_intmax_t="yes" else @@ -6795,20 +6793,20 @@ fi echo $ac_n "checking for intXX_t types""... $ac_c" 1>&6 -echo "configure:6799: checking for intXX_t types" >&5 +echo "configure:6797: 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:6812: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6810: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_intxx_t="yes" else @@ -6832,20 +6830,20 @@ EOF fi echo $ac_n "checking for int64_t type""... $ac_c" 1>&6 -echo "configure:6836: checking for int64_t type" >&5 +echo "configure:6834: 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:6849: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6847: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_int64_t="yes" else @@ -6869,20 +6867,20 @@ EOF fi echo $ac_n "checking for u_intXX_t types""... $ac_c" 1>&6 -echo "configure:6873: checking for u_intXX_t types" >&5 +echo "configure:6871: 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:6886: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6884: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_u_intxx_t="yes" else @@ -6906,20 +6904,20 @@ EOF fi echo $ac_n "checking for u_int64_t types""... $ac_c" 1>&6 -echo "configure:6910: checking for u_int64_t types" >&5 +echo "configure:6908: 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:6923: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6921: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_u_int64_t="yes" else @@ -6946,9 +6944,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:6950: checking for intXX_t and u_intXX_t types in sys/bitypes.h" >&5 +echo "configure:6948: checking for intXX_t and u_intXX_t types in sys/bitypes.h" >&5 cat > conftest.$ac_ext < int main() { @@ -6957,7 +6955,7 @@ int main() { a = b = c = e = f = g = 1; ; return 0; } EOF -if { (eval echo configure:6961: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6959: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_U_INTXX_T 1 @@ -6984,13 +6982,13 @@ fi if test -z "$have_u_intxx_t" ; then echo $ac_n "checking for uintXX_t types""... $ac_c" 1>&6 -echo "configure:6988: checking for uintXX_t types" >&5 +echo "configure:6986: 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() { @@ -6998,7 +6996,7 @@ int main() { uint32_t c; a = b = c = 1; ; return 0; } EOF -if { (eval echo configure:7002: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7000: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_uintxx_t="yes" else @@ -7038,12 +7036,12 @@ for ac_func in \ do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7042: checking for $ac_func" >&5 +echo "configure:7040: 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:7068: \"$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 @@ -7096,12 +7094,12 @@ done for ac_func in fchdir do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7100: checking for $ac_func" >&5 +echo "configure:7098: 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:7126: \"$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 @@ -7155,12 +7153,12 @@ done for ac_func in snprintf vsnprintf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7159: checking for $ac_func" >&5 +echo "configure:7157: 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:7185: \"$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 @@ -7211,12 +7209,12 @@ done for ac_func in localtime_r do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7215: checking for $ac_func" >&5 +echo "configure:7213: 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:7241: \"$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 @@ -7270,12 +7268,12 @@ done for ac_func in readdir_r do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7274: checking for $ac_func" >&5 +echo "configure:7272: 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:7300: \"$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 @@ -7328,12 +7326,12 @@ done # Find where sockets are (especially for Solaris) echo $ac_n "checking for socket""... $ac_c" 1>&6 -echo "configure:7332: checking for socket" >&5 +echo "configure:7330: 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:7358: \"$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 @@ -7374,7 +7372,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:7378: checking for socket in -lxnet" >&5 +echo "configure:7376: 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 @@ -7382,7 +7380,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:7395: \"$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 @@ -7421,7 +7419,7 @@ else fi echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6 -echo "configure:7425: checking for socket in -lsocket" >&5 +echo "configure:7423: 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 @@ -7429,7 +7427,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:7442: \"$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 @@ -7468,7 +7466,7 @@ else fi echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6 -echo "configure:7472: checking for socket in -linet" >&5 +echo "configure:7470: 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 @@ -7476,7 +7474,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:7489: \"$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 @@ -7519,12 +7517,12 @@ fi # If resolver functions are not in libc check for -lnsl or -lresolv. echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 -echo "configure:7523: checking for gethostbyname" >&5 +echo "configure:7521: 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:7549: \"$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 @@ -7565,7 +7563,7 @@ if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:7569: checking for gethostbyname in -lnsl" >&5 +echo "configure:7567: 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 @@ -7573,7 +7571,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:7586: \"$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 @@ -7612,7 +7610,7 @@ else fi echo $ac_n "checking for gethostbyname in -lresolv""... $ac_c" 1>&6 -echo "configure:7616: checking for gethostbyname in -lresolv" >&5 +echo "configure:7614: checking for gethostbyname in -lresolv" >&5 ac_lib_var=`echo resolv'_'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 @@ -7620,7 +7618,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:7633: \"$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 @@ -7663,12 +7661,12 @@ fi echo $ac_n "checking for strftime""... $ac_c" 1>&6 -echo "configure:7667: checking for strftime" >&5 +echo "configure:7665: 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:7693: \"$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 @@ -7713,7 +7711,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:7717: checking for strftime in -lintl" >&5 +echo "configure:7715: 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 @@ -7721,7 +7719,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:7734: \"$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 @@ -7759,12 +7757,12 @@ fi fi echo $ac_n "checking for vprintf""... $ac_c" 1>&6 -echo "configure:7763: checking for vprintf" >&5 +echo "configure:7761: 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:7789: \"$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 @@ -7811,12 +7809,12 @@ fi if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:7815: checking for _doprnt" >&5 +echo "configure:7813: 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:7841: \"$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 @@ -7866,19 +7864,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:7870: checking for working alloca.h" >&5 +echo "configure:7868: 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:7882: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7880: \"$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 @@ -7899,12 +7897,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:7903: checking for alloca" >&5 +echo "configure:7901: 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:7934: \"$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 @@ -7964,12 +7962,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:7968: checking whether alloca needs Cray hooks" >&5 +echo "configure:7966: 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:7998: checking for $ac_func" >&5 +echo "configure:7996: 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:8024: \"$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 @@ -8049,7 +8047,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:8053: checking stack direction for C alloca" >&5 +echo "configure:8051: 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 @@ -8057,7 +8055,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:8078: \"$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 @@ -8099,7 +8097,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:8103: checking for getmntent in -lsun" >&5 +echo "configure:8101: 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 @@ -8107,7 +8105,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:8120: \"$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 @@ -8137,7 +8135,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:8141: checking for getmntent in -lseq" >&5 +echo "configure:8139: 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 @@ -8145,7 +8143,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:8158: \"$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 @@ -8175,7 +8173,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:8179: checking for getmntent in -lgen" >&5 +echo "configure:8177: 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 @@ -8183,7 +8181,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:8196: \"$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 @@ -8219,12 +8217,12 @@ fi fi echo $ac_n "checking for getmntent""... $ac_c" 1>&6 -echo "configure:8223: checking for getmntent" >&5 +echo "configure:8221: 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:8249: \"$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 @@ -8270,7 +8268,7 @@ else fi echo $ac_n "checking whether closedir returns void""... $ac_c" 1>&6 -echo "configure:8274: checking whether closedir returns void" >&5 +echo "configure:8272: 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 @@ -8278,13 +8276,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:8288: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8286: \"$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 @@ -8307,7 +8305,7 @@ EOF fi echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6 -echo "configure:8311: checking whether setpgrp takes no argument" >&5 +echo "configure:8309: 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 @@ -8315,7 +8313,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:8337: \"$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 @@ -8358,7 +8356,7 @@ EOF fi echo $ac_n "checking for working fnmatch""... $ac_c" 1>&6 -echo "configure:8362: checking for working fnmatch" >&5 +echo "configure:8360: 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 @@ -8369,11 +8367,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:8375: \"$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 @@ -8398,7 +8396,7 @@ fi echo $ac_n "checking for setlocale in -lxpg4""... $ac_c" 1>&6 -echo "configure:8402: checking for setlocale in -lxpg4" >&5 +echo "configure:8400: 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 @@ -8406,7 +8404,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:8419: \"$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 @@ -8440,7 +8438,7 @@ fi echo $ac_n "checking for getpwnam in -lsun""... $ac_c" 1>&6 -echo "configure:8444: checking for getpwnam in -lsun" >&5 +echo "configure:8442: 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 @@ -8448,7 +8446,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:8461: \"$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 @@ -8487,7 +8485,7 @@ else fi echo $ac_n "checking for deflate in -lz""... $ac_c" 1>&6 -echo "configure:8491: checking for deflate in -lz" >&5 +echo "configure:8489: 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 @@ -8495,7 +8493,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:8508: \"$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 @@ -8533,7 +8531,7 @@ fi PTHREAD_LIB="" echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 -echo "configure:8537: checking for pthread_create in -lpthread" >&5 +echo "configure:8535: 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 @@ -8541,7 +8539,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:8554: \"$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 @@ -8571,7 +8569,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:8575: checking for pthread_create in -lpthreads" >&5 +echo "configure:8573: 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 @@ -8579,7 +8577,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:8592: \"$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 @@ -8609,7 +8607,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:8613: checking for pthread_create in -lc_r" >&5 +echo "configure:8611: 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 @@ -8617,7 +8615,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:8630: \"$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 @@ -8647,12 +8645,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:8651: checking for pthread_create" >&5 +echo "configure:8649: 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:8677: \"$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 @@ -9015,6 +9013,7 @@ trap 'rm -fr `echo "autoconf/Make.common \ src/cats/create_mysql_database \ src/cats/grant_mysql_privileges \ src/cats/make_sqlite_tables \ + src/cats/drop_sqlite_tables \ src/cats/sqlite \ src/findlib/Makefile \ $PFILES src/config.h:autoconf/config.h.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 @@ -9132,11 +9131,11 @@ s%@CONS_INC@%$CONS_INC%g s%@CONS_LIBS@%$CONS_LIBS%g s%@CONS_LDFLAGS@%$CONS_LDFLAGS%g s%@READLINE_SRC@%$READLINE_SRC%g -s%@TERMCAP_LIB@%$TERMCAP_LIB%g s%@GMP_INC@%$GMP_INC%g s%@GMP_LIBS@%$GMP_LIBS%g s%@GMP_LDFLAGS@%$GMP_LDFLAGS%g s%@GMP_SRC@%$GMP_SRC%g +s%@CWEB@%$CWEB%g s%@CWEB_INC@%$CWEB_INC%g s%@CWEB_LIBS@%$CWEB_LIBS%g s%@CWEB_LDFLAGS@%$CWEB_LDFLAGS%g @@ -9248,6 +9247,7 @@ CONFIG_FILES=\${CONFIG_FILES-"autoconf/Make.common \ src/cats/create_mysql_database \ src/cats/grant_mysql_privileges \ src/cats/make_sqlite_tables \ + src/cats/drop_sqlite_tables \ src/cats/sqlite \ src/findlib/Makefile \ $PFILES "} @@ -9440,7 +9440,7 @@ chmod 755 src/cats/make_mysql_tables src/cats/drop_mysql_tables chmod 755 src/cats/make_test_tables src/cats/drop_test_tables chmod 755 src/cats/create_mysql_database chmod 755 src/cats/grant_mysql_privileges -chmod 755 src/cats/make_sqlite_tables +chmod 755 src/cats/make_sqlite_tables src/cats/drop_sqlite_tables chmod 755 src/cats/sqlite diff --git a/bacula/src/cats/cats.h b/bacula/src/cats/cats.h index 5c50c0bfd7..4570d4b27a 100644 --- a/bacula/src/cats/cats.h +++ b/bacula/src/cats/cats.h @@ -41,6 +41,8 @@ typedef int (DB_RESULT_HANDLER)(void *, int, char **); #ifdef HAVE_SQLITE +#define BDB_VERSION 1 + #include /* Define opaque structure for sqlite */ @@ -120,6 +122,8 @@ extern void my_sqlite_free_table(B_DB *mdb); #ifdef HAVE_MYSQL +#define BDB_VERSION 1 + #include /* @@ -250,7 +254,7 @@ typedef struct { time_t SchedTime; /* Time job scheduled */ time_t StartTime; /* Job start time */ time_t EndTime; /* Job termination time */ - btime_t StartDay; /* Start time/date in seconds */ + btime_t JobTDate; /* Backup time/date in seconds */ uint32_t VolSessionId; uint32_t VolSessionTime; uint32_t JobFiles; @@ -331,9 +335,9 @@ typedef struct { int UseOnce; /* set to use once only */ int UseCatalog; /* set to use catalog */ int AcceptAnyVolume; /* set to accept any volume sequence */ - int AutoRecycle; /* set to recycle automatically */ + int AutoPrune; /* set to prune automatically */ int Recycle; /* default Vol recycle flag */ - btime_t VolumeRetention; /* retention period in seconds */ + btime_t VolRetention; /* retention period in seconds */ char PoolType[MAX_NAME_LENGTH]; char LabelFormat[MAX_NAME_LENGTH]; /* Extra stuff not in DB */ diff --git a/bacula/src/cats/drop_mysql_tables.in b/bacula/src/cats/drop_mysql_tables.in index 0dfaefb2de..14f2ea0d9d 100644 --- a/bacula/src/cats/drop_mysql_tables.in +++ b/bacula/src/cats/drop_mysql_tables.in @@ -1,6 +1,6 @@ #!/bin/sh # -# shell script to delete Bacula tables +# shell script to delete Bacula tables for MySQL bindir=@SQL_BINDIR@ @@ -18,10 +18,11 @@ DROP TABLE IF EXISTS Pool; DROP TABLE IF EXISTS MultiVolume; DROP TABLE IF EXISTS FileSave; DROP TABLE IF EXISTS FileSet; +DROP TABLE IF EXISTS Version; END-OF-DATA then - echo "Deletion of Bacula tables succeeded." + echo "Deletion of Bacula MySQL tables succeeded." else - echo "Deletion of Bacula tables failed." + echo "Deletion of Bacula MySQL tables failed." fi exit 0 diff --git a/bacula/src/cats/drop_sqlite_tables.in b/bacula/src/cats/drop_sqlite_tables.in new file mode 100644 index 0000000000..1365db6f5d --- /dev/null +++ b/bacula/src/cats/drop_sqlite_tables.in @@ -0,0 +1,7 @@ +#!/bin/sh +# +# shell script to Delete the SQLite Bacula database (same as deleting +# the tables) +# + +rm -f @working_dir@/bacula.db diff --git a/bacula/src/cats/make_mysql_tables.in b/bacula/src/cats/make_mysql_tables.in index 2c155f9913..c5acf7a08a 100644 --- a/bacula/src/cats/make_mysql_tables.in +++ b/bacula/src/cats/make_mysql_tables.in @@ -49,7 +49,7 @@ CREATE TABLE Job ( SchedTime DATETIME NOT NULL, StartTime DATETIME NOT NULL, EndTime DATETIME NOT NULL, - StartDay BIGINT UNSIGNED NOT NULL, + JobTDate BIGINT UNSIGNED NOT NULL, VolSessionId INTEGER UNSIGNED NOT NULL, VolSessionTime INTEGER UNSIGNED NOT NULL, JobFiles INTEGER UNSIGNED NOT NULL, @@ -117,10 +117,10 @@ CREATE TABLE Pool ( MaxVols INTEGER UNSIGNED NOT NULL, UseOnce TINYINT NOT NULL, UseCatalog TINYINT NOT NULL, - AcceptAnyVolume TINYINT NOT NULL, - VolRetention BIGINT NOT NULL, - AutoRecycle TINYINT NOT NULL, - Recycle TINYINT NOT NULL, + AcceptAnyVolume TINYINT DEFAULT 0, + VolRetention BIGINT UNSIGNED NOT NULL, + AutoPrune TINYINT DEFAULT 0, + Recycle TINYINT DEFAULT 0, PoolType ENUM('Backup', 'Copy', 'Cloned', 'Archive', 'Migration') NOT NULL, LabelFormat TINYBLOB, UNIQUE (Name(128)), @@ -132,9 +132,9 @@ CREATE TABLE Client ( ClientId INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, Name TINYBLOB NOT NULL, Uname TINYBLOB NOT NULL, /* full uname -a of client */ - AutoPrune TINYINT NOT NULL, - FileRetention BIGINT NOT NULL, - JobRetention BIGINT NOT NULL, + AutoPrune TINYINT DEFAULT 0, + FileRetention BIGINT UNSIGNED NOT NULL, + JobRetention BIGINT UNSIGNED NOT NULL, UNIQUE (Name(128)), PRIMARY KEY(ClientId) ); diff --git a/bacula/src/cats/make_sqlite_tables.in b/bacula/src/cats/make_sqlite_tables.in index ad51ac11dd..31b29ec9f6 100644 --- a/bacula/src/cats/make_sqlite_tables.in +++ b/bacula/src/cats/make_sqlite_tables.in @@ -42,7 +42,7 @@ CREATE TABLE Job ( SchedTime DATETIME NOT NULL, StartTime DATETIME DEFAULT 0, EndTime DATETIME DEFAULT 0, - StartDay BIGINT UNSIGNED DEFAULT 0, + JobTDate BIGINT UNSIGNED DEFAULT 0, VolSessionId INTEGER UNSIGNED DEFAULT 0, VolSessionTime INTEGER UNSIGNED DEFAULT 0, JobFiles INTEGER UNSIGNED DEFAULT 0, @@ -93,22 +93,22 @@ CREATE TABLE Media ( VolMaxBytes BIGINT UNSIGNED DEFAULT 0, VolCapacityBytes BIGINT UNSIGNED DEFAULT 0, VolStatus VARCHAR(20) NOT NULL, - Recycle TINYINT NOT NULL, - VolRetention BIGINT UNSIGNED NOT NULL, + Recycle TINYINT DEFAULT 0, + VolRetention BIGINT UNSIGNED DEFAULT 0, PRIMARY KEY(MediaId) ); CREATE TABLE Pool ( PoolId INTEGER UNSIGNED AUTOINCREMENT, Name VARCHAR(128) NOT NULL, - NumVols INTEGER UNSIGNED NOT NULL, - MaxVols INTEGER UNSIGNED NOT NULL, - UseOnce TINYINT NOT NULL, - UseCatalog TINYINT NOT NULL, - AcceptAnyVolume TINYINT NOT NULL, - VolRetention BIGINT NOT NULL, - AutoRecycle TINYINT NOT NULL, - Recycle TINYINT NOT NULL, + NumVols INTEGER UNSIGNED DEFAULT 0, + MaxVols INTEGER UNSIGNED DEFAULT 0, + UseOnce TINYINT DEFAULT 0, + UseCatalog TINYINT DEFAULT 1, + AcceptAnyVolume TINYINT DEFAULT 0, + VolRetention BIGINT UNSIGNED DEFAULT 0, + AutoPrune TINYINT DEFAULT 0, + Recycle TINYINT DEFAULT 0, PoolType VARCHAR(20) NOT NULL, LabelFormat VARCHAR(128) NOT NULL, UNIQUE (Name), @@ -120,9 +120,9 @@ CREATE TABLE Client ( ClientId INTEGER UNSIGNED AUTOINCREMENT, Name VARCHAR(128) NOT NULL, Uname VARCHAR(255) NOT NULL, -- uname -a field - AutoPrune TINYINT NOT NULL, - FileRetention BIGINT NOT NULL, - JobRetention BIGINT NOT NULL, + AutoPrune TINYINT DEFAULT 0, + FileRetention BIGINT UNSIGNED DEFAULT 0, + JobRetention BIGINT UNSIGNED DEFAULT 0, UNIQUE (Name), PRIMARY KEY(ClientId) ); diff --git a/bacula/src/cats/sql.c b/bacula/src/cats/sql.c index 21fdbe4436..647d4115c5 100644 --- a/bacula/src/cats/sql.c +++ b/bacula/src/cats/sql.c @@ -41,6 +41,22 @@ void print_dashes(B_DB *mdb); void print_result(B_DB *mdb); +/* + * Called here to retrieve an integer from the database + */ +static int int_handler(void *ctx, int num_fields, char **row) +{ + uint32_t *val = (uint32_t *)ctx; + + if (row[0]) { + *val = atoi(row[0]); + } else { + *val = 0; + } + return 0; +} + + /* NOTE!!! The following routines expect that the * calling subroutine sets and clears the mutex @@ -49,7 +65,16 @@ void print_result(B_DB *mdb); /* Check that the tables conrrespond to the version we want */ int check_tables_version(B_DB *mdb) { -/*****FIXME***** implement */ + uint32_t version; + char *query = "SELECT VersionId FROM Version"; + + version = 0; + db_sql_query(mdb, query, int_handler, (void *)&version); + if (version != BDB_VERSION) { + Mmsg(&mdb->errmsg, "Database version mismatch. Wanted %d, got %d\n", + BDB_VERSION, version); + return 0; + } return 1; } diff --git a/bacula/src/cats/sql_create.c b/bacula/src/cats/sql_create.c index 73aa0c7813..479f97fea0 100644 --- a/bacula/src/cats/sql_create.c +++ b/bacula/src/cats/sql_create.c @@ -68,15 +68,14 @@ db_create_job_record(B_DB *mdb, JOB_DBR *jr) struct tm tm; int stat; char *JobId; - btime_t StartDay; + btime_t JobTDate; char ed1[30]; stime = jr->SchedTime; localtime_r(&stime, &tm); strftime(dt, sizeof(dt), "%Y-%m-%d %T", &tm); - StartDay = (btime_t)(date_encode(tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday) - - date_encode(2000, 1, 1)); + JobTDate = (btime_t)stime; P(mdb->mutex); JobId = db_next_index(mdb, "Job"); @@ -87,10 +86,10 @@ db_create_job_record(B_DB *mdb, JOB_DBR *jr) } /* Must create it */ Mmsg(&mdb->cmd, -"INSERT INTO Job (JobId, Job, Name, Type, Level, SchedTime, StartDay) VALUES \ +"INSERT INTO Job (JobId, Job, Name, Type, Level, SchedTime, JobTDate) VALUES \ (%s, \"%s\", \"%s\", \"%c\", \"%c\", \"%s\", %s)", JobId, jr->Job, jr->Name, (char)(jr->Type), (char)(jr->Level), dt, - edit_uint64(StartDay, ed1)); + edit_uint64(JobTDate, ed1)); if (!INSERT_DB(mdb, mdb->cmd)) { Mmsg2(&mdb->errmsg, _("Create DB Job record %s failed. ERR=%s\n"), @@ -157,13 +156,13 @@ VALUES (%d, %d, %u, %u)", * 1 on success */ int -db_create_pool_record(B_DB *mdb, POOL_DBR *pool_dbr) +db_create_pool_record(B_DB *mdb, POOL_DBR *pr) { int stat; char ed1[30]; P(mdb->mutex); - Mmsg(&mdb->cmd, "SELECT PoolId,Name FROM Pool WHERE Name=\"%s\"", pool_dbr->Name); + Mmsg(&mdb->cmd, "SELECT PoolId,Name FROM Pool WHERE Name=\"%s\"", pr->Name); Dmsg1(20, "selectpool: %s\n", mdb->cmd); if (QUERY_DB(mdb, mdb->cmd)) { @@ -171,7 +170,7 @@ db_create_pool_record(B_DB *mdb, POOL_DBR *pool_dbr) mdb->num_rows = sql_num_rows(mdb); if (mdb->num_rows > 0) { - Mmsg1(&mdb->errmsg, _("pool record %s already exists\n"), pool_dbr->Name); + Mmsg1(&mdb->errmsg, _("pool record %s already exists\n"), pr->Name); sql_free_result(mdb); V(mdb->mutex); return 0; @@ -182,23 +181,23 @@ db_create_pool_record(B_DB *mdb, POOL_DBR *pool_dbr) /* Must create it */ Mmsg(&mdb->cmd, "INSERT INTO Pool (Name, NumVols, MaxVols, UseOnce, UseCatalog, \ -AcceptAnyVolume, AutoRecycle, Recycle, VolumeRetention, PoolType, LabelFormat) \ -VALUES (\"%s\", %d, %d, %d, %d, %d, %d, %d, %s \"%s\", \"%s\")", - pool_dbr->Name, - pool_dbr->NumVols, pool_dbr->MaxVols, - pool_dbr->UseOnce, pool_dbr->UseCatalog, - pool_dbr->AcceptAnyVolume, - pool_dbr->AutoRecycle, pool_dbr->Recycle, - edit_uint64(pool_dbr->VolumeRetention, ed1), - pool_dbr->PoolType, pool_dbr->LabelFormat); - +AcceptAnyVolume, AutoPrune, Recycle, VolRetention, PoolType, LabelFormat) \ +VALUES (\"%s\", %d, %d, %d, %d, %d, %d, %d, %s, \"%s\", \"%s\")", + pr->Name, + pr->NumVols, pr->MaxVols, + pr->UseOnce, pr->UseCatalog, + pr->AcceptAnyVolume, + pr->AutoPrune, pr->Recycle, + edit_uint64(pr->VolRetention, ed1), + pr->PoolType, pr->LabelFormat); + Dmsg1(500, "Create Pool: %s\n", mdb->cmd); if (!INSERT_DB(mdb, mdb->cmd)) { Mmsg2(&mdb->errmsg, _("Create db Pool record %s failed: ERR=%s\n"), mdb->cmd, sql_strerror(mdb)); - pool_dbr->PoolId = 0; + pr->PoolId = 0; stat = 0; } else { - pool_dbr->PoolId = sql_insert_id(mdb); + pr->PoolId = sql_insert_id(mdb); stat = 1; } V(mdb->mutex); @@ -237,7 +236,7 @@ db_create_media_record(B_DB *mdb, MEDIA_DBR *mr) /* Must create it */ Mmsg(&mdb->cmd, "INSERT INTO Media (VolumeName, MediaType, PoolId, VolMaxBytes, VolCapacityBytes, \ -VolStatus, Recycle) VALUES (\"%s\", \"%s\", %d, %s, %s, %d, %s, \"%s\")", +Recycle, VolRetention, VolStatus) VALUES (\"%s\", \"%s\", %d, %s, %s, %d, %s, \"%s\")", mr->VolumeName, mr->MediaType, mr->PoolId, edit_uint64(mr->VolMaxBytes,ed1), @@ -246,6 +245,7 @@ VolStatus, Recycle) VALUES (\"%s\", \"%s\", %d, %s, %s, %d, %s, \"%s\")", edit_uint64(mr->VolRetention, ed3), mr->VolStatus); + Dmsg1(500, "Create Volume: %s\n", mdb->cmd); if (!INSERT_DB(mdb, mdb->cmd)) { Mmsg2(&mdb->errmsg, _("Create DB Media record %s failed. ERR=%s\n"), mdb->cmd, sql_strerror(mdb)); @@ -303,7 +303,7 @@ int db_create_client_record(B_DB *mdb, CLIENT_DBR *cr) /* Must create it */ Mmsg(&mdb->cmd, "INSERT INTO Client (Name, Uname, AutoPrune, \ FileRetention, JobRetention) VALUES \ -(\"%s\", \"%s\")", cr->Name, cr->Uname, cr->AutoPrune, +(\"%s\", \"%s\", %d, %s, %s)", cr->Name, cr->Uname, cr->AutoPrune, edit_uint64(cr->FileRetention, ed1), edit_uint64(cr->JobRetention, ed2)); diff --git a/bacula/src/cats/sql_get.c b/bacula/src/cats/sql_get.c index aa1e39e804..5c154917f8 100644 --- a/bacula/src/cats/sql_get.c +++ b/bacula/src/cats/sql_get.c @@ -273,11 +273,11 @@ int db_get_job_record(B_DB *mdb, JOB_DBR *jr) P(mdb->mutex); if (jr->JobId == 0) { Mmsg(&mdb->cmd, "SELECT VolSessionId, VolSessionTime, \ -PoolId, StartTime, EndTime, JobFiles, JobBytes, StartDay, Job \ +PoolId, StartTime, EndTime, JobFiles, JobBytes, JobTDate, Job \ FROM Job WHERE Job=\"%s\"", jr->Job); } else { Mmsg(&mdb->cmd, "SELECT VolSessionId, VolSessionTime, \ -PoolId, StartTime, EndTime, JobFiles, JobBytes, StartDay, Job \ +PoolId, StartTime, EndTime, JobFiles, JobBytes, JobTDate, Job \ FROM Job WHERE JobId=%d", jr->JobId); } @@ -299,7 +299,7 @@ FROM Job WHERE JobId=%d", jr->JobId); strcpy(jr->cEndTime, row[4]); jr->JobFiles = atol(row[5]); jr->JobBytes = (uint64_t)strtod(row[6], NULL); - jr->StartDay = (btime_t)strtod(row[7], NULL); + jr->JobTDate = (btime_t)strtod(row[7], NULL); strcpy(jr->Job, row[8]); sql_free_result(mdb); @@ -425,10 +425,12 @@ int db_get_pool_record(B_DB *mdb, POOL_DBR *pdbr) if (pdbr->PoolId != 0) { /* find by id */ Mmsg(&mdb->cmd, "SELECT PoolId, Name, NumVols, MaxVols, UseOnce, UseCatalog, AcceptAnyVolume, \ +AutoPrune, Recycle, VolRetention, \ PoolType, LabelFormat FROM Pool WHERE Pool.PoolId=%d", pdbr->PoolId); } else { /* find by name */ Mmsg(&mdb->cmd, "SELECT PoolId, Name, NumVols, MaxVols, UseOnce, UseCatalog, AcceptAnyVolume, \ +AutoPrune, Recycle, VolRetention, \ PoolType, LabelFormat FROM Pool WHERE Pool.Name=\"%s\"", pdbr->Name); } @@ -451,9 +453,12 @@ PoolType, LabelFormat FROM Pool WHERE Pool.Name=\"%s\"", pdbr->Name); pdbr->UseOnce = atoi(row[4]); pdbr->UseCatalog = atoi(row[5]); pdbr->AcceptAnyVolume = atoi(row[6]); - strcpy(pdbr->PoolType, row[7]); - if (row[8]) { - strcpy(pdbr->LabelFormat, row[8]); + pdbr->AutoPrune = atoi(row[7]); + pdbr->Recycle = atoi(row[8]); + pdbr->VolRetention = (btime_t)strtod(row[9], NULL); + strcpy(pdbr->PoolType, row[10]); + if (row[11]) { + strcpy(pdbr->LabelFormat, row[11]); } else { pdbr->LabelFormat[0] = 0; } @@ -542,12 +547,12 @@ int db_get_media_record(B_DB *mdb, MEDIA_DBR *mr) if (mr->MediaId != 0) { /* find by id */ Mmsg(&mdb->cmd, "SELECT MediaId,VolumeName,VolJobs,VolFiles,VolBlocks,\ VolBytes,VolMounts,VolErrors,VolWrites,VolMaxBytes,VolCapacityBytes,\ -MediaType,VolStatus,PoolId \ +MediaType,VolStatus,PoolId,VoRetention,Recycle \ FROM Media WHERE MediaId=%d", mr->MediaId); } else { /* find by name */ Mmsg(&mdb->cmd, "SELECT MediaId,VolumeName,VolJobs,VolFiles,VolBlocks,\ VolBytes,VolMounts,VolErrors,VolWrites,VolMaxBytes,VolCapacityBytes,\ -MediaType,VolStatus,PoolId \ +MediaType,VolStatus,PoolId,VolRetention,Recycle \ FROM Media WHERE VolumeName=\"%s\"", mr->VolumeName); } @@ -578,6 +583,8 @@ FROM Media WHERE VolumeName=\"%s\"", mr->VolumeName); strcpy(mr->MediaType, row[11]); strcpy(mr->VolStatus, row[12]); mr->PoolId = atoi(row[13]); + mr->VolRetention = (btime_t)strtod(row[14], NULL); + mr->Recycle = atoi(row[15]); stat = mr->MediaId; } } else { diff --git a/bacula/src/cats/sql_list.c b/bacula/src/cats/sql_list.c index a6757a83b7..2fdef3f191 100644 --- a/bacula/src/cats/sql_list.c +++ b/bacula/src/cats/sql_list.c @@ -92,7 +92,7 @@ db_list_media_records(B_DB *mdb, MEDIA_DBR *mdbr, DB_LIST_HANDLER *sendit, void { Mmsg(&mdb->cmd, "SELECT VolumeName,MediaType,VolStatus,\ -VolBytes,LastWritten \ +VolBytes,LastWritten,VolRetention,Recycle \ FROM Media WHERE Media.PoolId=%d ORDER BY MediaId", mdbr->PoolId); P(mdb->mutex); diff --git a/bacula/src/cats/sql_update.c b/bacula/src/cats/sql_update.c index 1b6d2dbfce..eef77585c8 100644 --- a/bacula/src/cats/sql_update.c +++ b/bacula/src/cats/sql_update.c @@ -100,20 +100,19 @@ db_update_job_start_record(B_DB *mdb, JOB_DBR *jr) char dt[MAX_TIME_LENGTH]; time_t stime; struct tm tm; - btime_t StartDay; + btime_t JobTDate; int stat; char ed1[30]; stime = jr->StartTime; localtime_r(&stime, &tm); strftime(dt, sizeof(dt), "%Y-%m-%d %T", &tm); - StartDay = (btime_t)(date_encode(tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday) - - date_encode(2000, 1, 1)); + JobTDate = (btime_t)stime; P(mdb->mutex); Mmsg(&mdb->cmd, "UPDATE Job SET Level='%c', StartTime=\"%s\", \ -ClientId=%d, StartDay=%s WHERE JobId=%d", - (char)(jr->Level), dt, jr->ClientId, edit_uint64(StartDay, ed1), jr->JobId); +ClientId=%d, JobTDate=%s WHERE JobId=%d", + (char)(jr->Level), dt, jr->ClientId, edit_uint64(JobTDate, ed1), jr->JobId); stat = UPDATE_DB(mdb, mdb->cmd); V(mdb->mutex); return stat; @@ -135,22 +134,21 @@ db_update_job_end_record(B_DB *mdb, JOB_DBR *jr) struct tm tm; int stat; char ed1[30], ed2[30]; - btime_t StartDay; + btime_t JobTDate; ttime = jr->EndTime; localtime_r(&ttime, &tm); strftime(dt, sizeof(dt), "%Y-%m-%d %T", &tm); - StartDay = (btime_t)(date_encode(tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday) - - date_encode(2000, 1, 1)); + JobTDate = ttime; P(mdb->mutex); Mmsg(&mdb->cmd, "UPDATE Job SET JobStatus='%c', EndTime='%s', \ ClientId=%d, JobBytes=%s, JobFiles=%d, JobErrors=%d, VolSessionId=%d, \ -VolSessionTime=%d, PoolId=%d, FileSetId=%d, StartDay=%s WHERE JobId=%d", +VolSessionTime=%d, PoolId=%d, FileSetId=%d, JobTDate=%s WHERE JobId=%d", (char)(jr->JobStatus), dt, jr->ClientId, edit_uint64(jr->JobBytes, ed1), jr->JobFiles, jr->JobErrors, jr->VolSessionId, jr->VolSessionTime, - jr->PoolId, jr->FileSetId, edit_uint64(StartDay, ed2), jr->JobId); + jr->PoolId, jr->FileSetId, edit_uint64(JobTDate, ed2), jr->JobId); stat = UPDATE_DB(mdb, mdb->cmd); V(mdb->mutex); @@ -194,10 +192,11 @@ db_update_media_record(B_DB *mdb, MEDIA_DBR *mr) localtime_r(&ttime, &tm); strftime(dt, sizeof(dt), "%Y-%m-%d %T", &tm); + Dmsg1(000, "update_media: FirstWritte=%d\n", mr->FirstWritten); P(mdb->mutex); if (mr->VolMounts == 1) { - Mmsg(&mdb->cmd, "UPDATE Media SET FirstWritten=\"%s\" WHERE \ - VolumeName=\"%s\"", dt, mr->VolumeName); + Mmsg(&mdb->cmd, "UPDATE Media SET FirstWritten=\"%s\"\ + WHERE VolumeName=\"%s\"", dt, mr->VolumeName); if (do_update(mdb, mdb->cmd) == 0) { V(mdb->mutex); return 0; diff --git a/bacula/src/cats/sqlite.in b/bacula/src/cats/sqlite.in index 63c2ba27d1..89160b5e9f 100644 --- a/bacula/src/cats/sqlite.in +++ b/bacula/src/cats/sqlite.in @@ -2,4 +2,5 @@ # # shell script to invoke SQLite on Bacula database -@bindir@/sqlite @working_dir@/bacula.db +bindir=@SQL_BINDIR@ +$bindir/sqlite @working_dir@/bacula.db diff --git a/bacula/src/console/Makefile.in b/bacula/src/console/Makefile.in index f061bcd5ab..2cafd53e6a 100644 --- a/bacula/src/console/Makefile.in +++ b/bacula/src/console/Makefile.in @@ -42,7 +42,7 @@ all: Makefile console console: $(CONSOBJS) ../lib/libbac.a ../cats/libsql.a $(CXX) $(LDFLAGS) $(CONS_LDFLAGS) -L../lib -L../cats -o $@ $(CONSOBJS) \ - $(LIBS) $(DLIB) $(CONS_LIBS) -lbac -lsql -lm -ltermcap + $(LIBS) $(DLIB) $(CONS_LIBS) -lbac -lsql -lm Makefile: $(srcdir)/Makefile.in $(topdir)/config.status cd $(topdir) \ diff --git a/bacula/src/console/console.c b/bacula/src/console/console.c index 3108ef206b..24c6e7a8aa 100644 --- a/bacula/src/console/console.c +++ b/bacula/src/console/console.c @@ -148,7 +148,7 @@ int main(int argc, char *argv[]) * Ensure that every message is always printed */ for (i=1; i<=M_MAX; i++) { - add_msg_dest(MD_STDOUT, i, NULL, NULL); + add_msg_dest(NULL, MD_STDOUT, i, NULL, NULL); } diff --git a/bacula/src/dird/dird_conf.c b/bacula/src/dird/dird_conf.c index 8689a33b08..0d7937c7e5 100644 --- a/bacula/src/dird/dird_conf.c +++ b/bacula/src/dird/dird_conf.c @@ -110,7 +110,7 @@ static struct res_items cli_items[] = { {"catalog", store_res, ITEM(res_client.catalog), R_CATALOG, 0, 0}, {"fileretention", store_time, ITEM(res_client.FileRetention), 0, ITEM_DEFAULT, 60*60*24*30}, {"jobretention", store_time, ITEM(res_client.JobRetention), 0, ITEM_DEFAULT, 60*60*24*365}, - {"autoprune", store_yesno, ITEM(res_client.AutoPrune), 1, ITEM_DEFAULT, 1}, + {"autoprune", store_yesno, ITEM(res_client.AutoPrune), 1, ITEM_DEFAULT, 0}, {NULL, NULL, NULL, 0, 0, 0} }; @@ -215,9 +215,9 @@ static struct res_items pool_items[] = { {"maximumvolumes", store_pint, ITEM(res_pool.max_volumes), 0, 0, 0}, {"acceptanyvolume", store_yesno, ITEM(res_pool.accept_any_volume), 1, 0, 0}, {"catalogfiles", store_yesno, ITEM(res_pool.catalog_files), 1, ITEM_DEFAULT, 1}, - {"volumeretention", store_time, ITEM(res_pool.VolumeRetention), 0, ITEM_DEFAULT, 60*60*24*365}, - {"autorecycle", store_yesno, ITEM(res_pool.AutoRecycle), 1, ITEM_DEFAULT, 1}, - {"recycle", store_yesno, ITEM(res_pool.Recycle), 1, ITEM_DEFAULT, 1}, + {"volumeretention", store_time, ITEM(res_pool.VolRetention), 0, ITEM_DEFAULT, 60*60*24*365}, + {"autoprune", store_yesno, ITEM(res_pool.AutoPrune), 1, ITEM_DEFAULT, 0}, + {"recycle", store_yesno, ITEM(res_pool.Recycle), 1, ITEM_DEFAULT, 0}, {NULL, NULL, NULL, 0, 0, 0} }; @@ -451,9 +451,11 @@ void dump_resource(int type, RES *reshdr, void sendit(void *sock, char *fmt, ... sendit(sock, " use_cat=%d use_once=%d acpt_any=%d cat_files=%d\n", res->res_pool.use_catalog, res->res_pool.use_volume_once, res->res_pool.accept_any_volume, res->res_pool.catalog_files); - sendit(sock, " max_vols=%d auto_recycle=%d VolumeRetention=%" lld "\n", - res->res_pool.max_volumes, res->res_pool.AutoRecycle, - res->res_pool.VolumeRetention); + sendit(sock, " max_vols=%d auto_prune=%d VolRetention=%" lld "\n", + res->res_pool.max_volumes, res->res_pool.AutoPrune, + res->res_pool.VolRetention); + sendit(sock, " recycle=%d\n", res->res_pool.Recycle); + sendit(sock, " LabelFormat=%s\n", res->res_pool.label_format? res->res_pool.label_format:"NONE"); diff --git a/bacula/src/dird/dird_conf.h b/bacula/src/dird/dird_conf.h index 8f1753440e..f70441d526 100644 --- a/bacula/src/dird/dird_conf.h +++ b/bacula/src/dird/dird_conf.h @@ -213,8 +213,8 @@ struct s_res_pool { int use_volume_once; /* write on volume only once */ int accept_any_volume; /* accept any volume */ int max_volumes; /* max number of volumes */ - btime_t VolumeRetention; /* volume retention period in seconds */ - int AutoRecycle; /* default for pool auto recycle */ + btime_t VolRetention; /* volume retention period in seconds */ + int AutoPrune; /* default for pool auto prune */ int Recycle; /* default for media recycle yes/no */ }; typedef struct s_res_pool POOL; diff --git a/bacula/src/dird/newvol.c b/bacula/src/dird/newvol.c index e3982203d9..bf698a382b 100644 --- a/bacula/src/dird/newvol.c +++ b/bacula/src/dird/newvol.c @@ -8,7 +8,7 @@ * This routine runs as a thread and must be thread reentrant. * * Basic tasks done here: - * If possible create a new Media entry + * If possible create a new Media entry * */ /* @@ -52,22 +52,22 @@ int newVolume(JCR *jcr) if (db_get_pool_record(jcr->db, &pr) && pr.LabelFormat[0] && pr.LabelFormat[0] != '*') { if (pr.MaxVols == 0 || pr.NumVols < pr.MaxVols) { - memset(&mr, 0, sizeof(mr)); - mr.PoolId = jcr->PoolId; - strcpy(mr.MediaType, jcr->store->media_type); - strcpy(name, pr.LabelFormat); + memset(&mr, 0, sizeof(mr)); + mr.PoolId = jcr->PoolId; + strcpy(mr.MediaType, jcr->store->media_type); + strcpy(name, pr.LabelFormat); strcat(name, "%04d"); - sprintf(mr.VolumeName, name, ++pr.NumVols); + sprintf(mr.VolumeName, name, ++pr.NumVols); strcpy(mr.VolStatus, "Append"); - mr.Recycle = pr.Recycle; - mr.VolRetention = pr.VolumeRetention; - if (db_create_media_record(jcr->db, &mr) && - db_update_pool_record(jcr->db, &pr) == 1) { + mr.Recycle = pr.Recycle; + mr.VolRetention = pr.VolRetention; + if (db_create_media_record(jcr->db, &mr) && + db_update_pool_record(jcr->db, &pr) == 1) { Dmsg1(90, "Created new Volume=%s\n", mr.VolumeName); - return 1; - } else { + return 1; + } else { Jmsg(jcr, M_ERROR, 0, "%s", db_strerror(jcr->db)); - } + } } } return 0; diff --git a/bacula/src/dird/ua_cmds.c b/bacula/src/dird/ua_cmds.c index ff24bb6b14..b3eb5b2783 100644 --- a/bacula/src/dird/ua_cmds.c +++ b/bacula/src/dird/ua_cmds.c @@ -61,9 +61,9 @@ static int deletecmd(UAContext *ua, char *cmd); static int usecmd(UAContext *ua, char *cmd), unmountcmd(UAContext *ua, char *cmd); static int labelcmd(UAContext *ua, char *cmd), mountcmd(UAContext *ua, char *cmd), updatecmd(UAContext *ua, char *cmd); static int versioncmd(UAContext *ua, char *cmd), automountcmd(UAContext *ua, char *cmd); -static int update_media(UAContext *ua); +static int update_volume(UAContext *ua); static int update_pool(UAContext *ua); -static int delete_media(UAContext *ua); +static int delete_volume(UAContext *ua); static int delete_pool(UAContext *ua); int quitcmd(UAContext *ua, char *cmd); @@ -242,7 +242,7 @@ getVolName: mr.PoolId = pr.PoolId; strcpy(mr.VolStatus, "Append"); mr.Recycle = pr.Recycle; - mr.VolRetention = pr.VolumeRetention; + mr.VolRetention = pr.VolRetention; for (i=startnum; i < num+startnum; i++) { sprintf(mr.VolumeName, name, i); Dmsg1(200, "Create Volume %s\n", mr.VolumeName); @@ -458,6 +458,10 @@ int create_pool(B_DB *db, POOL *pool) pr.UseOnce = pool->use_volume_once; pr.UseCatalog = pool->use_catalog; pr.AcceptAnyVolume = pool->accept_any_volume; + pr.Recycle = pool->Recycle; + pr.VolRetention = pool->VolRetention; +Dmsg1(000, "Retention=%d\n", (uint32_t)pr.VolRetention); + pr.AutoPrune = pool->AutoPrune; if (pool->label_format) { strcpy(pr.LabelFormat, pool->label_format); } else { @@ -532,7 +536,7 @@ static int updatecmd(UAContext *ua, char *cmd) switch (find_arg_keyword(ua, kw)) { case 0: case 1: - update_media(ua); + update_volume(ua); return 1; case 2: update_pool(ua); @@ -543,13 +547,13 @@ static int updatecmd(UAContext *ua, char *cmd) start_prompt(ua, _("Update choice:\n")); add_prompt(ua, _("pool")); - add_prompt(ua, _("media")); + add_prompt(ua, _("volume")); switch (do_prompt(ua, _("Choose catalog item to update"), NULL)) { case 0: update_pool(ua); break; case 1: - update_media(ua); + update_volume(ua); break; default: break; @@ -563,7 +567,7 @@ static int updatecmd(UAContext *ua, char *cmd) * writing on the volume, set it to anything other * than Append. */ -static int update_media(UAContext *ua) +static int update_volume(UAContext *ua) { POOL_DBR pr; MEDIA_DBR mr; @@ -571,11 +575,13 @@ static int update_media(UAContext *ua) static char *kw[] = { "volume", NULL}; + char *query; + char ed1[30]; memset(&pr, 0, sizeof(pr)); memset(&mr, 0, sizeof(mr)); if (!get_pool_dbr(ua, &pr)) { - return 1; + return 0; } mr.PoolId = pr.PoolId; mr.VolumeName[0] = 0; @@ -587,27 +593,68 @@ static int update_media(UAContext *ua) if (mr.VolumeName[0] == 0) { db_list_media_records(ua->db, &mr, prtit, ua); if (!get_cmd(ua, _("Enter Volume name to update: "))) { - return 1; + return 0; } strcpy(mr.VolumeName, ua->cmd); } mr.MediaId = 0; if (!db_get_media_record(ua->db, &mr)) { - bsendmsg(ua, _("Media record for %s not found.\n"), mr.VolumeName); - return 1; + bsendmsg(ua, _("Volume record for %s not found.\n"), mr.VolumeName); + return 0; } - start_prompt(ua, _("Volume Status Values:\n")); - add_prompt(ua, "Append"); - add_prompt(ua, "Archive"); - add_prompt(ua, "Disabled"); - add_prompt(ua, "Full"); - add_prompt(ua, "Recycle"); - add_prompt(ua, "Read-Only"); - if (do_prompt(ua, _("Choose new Volume Status"), ua->cmd) < 0) { - return 1; + + for (int done=0; !done; ) { + start_prompt(ua, _("Parameters to modify:\n")); + add_prompt(ua, _("Volume Status")); + add_prompt(ua, _("Volume Retention")); + add_prompt(ua, _("Done")); + switch (do_prompt(ua, _("Select paramter to modify"), NULL)) { + case 0: /* Volume Status */ + /* Modify Volume */ + bsendmsg(ua, _("Current value is: %s\n"), mr.VolStatus); + start_prompt(ua, _("Possible Values are:\n")); + add_prompt(ua, "Append"); + add_prompt(ua, "Archive"); + add_prompt(ua, "Disabled"); + add_prompt(ua, "Full"); + if (strcmp(mr.VolStatus, "Purged") == 0) { + add_prompt(ua, "Recycle"); + } + add_prompt(ua, "Read-Only"); + if (do_prompt(ua, _("Choose new Volume Status"), ua->cmd) < 0) { + return 1; + } + strcpy(mr.VolStatus, ua->cmd); + query = (char *)get_pool_memory(PM_MESSAGE); + Mmsg(&query, "UPDATE Media SET VolStatus=\"%s\" WHERE MediaId=%d", + mr.VolStatus, mr.MediaId); + if (!db_sql_query(ua->db, query, NULL, NULL)) { + bsendmsg(ua, "%s", db_strerror(ua->db)); + } + free_pool_memory(query); + break; + case 1: /* Retention */ + bsendmsg(ua, _("Current value is: %s\n"), + edit_btime(mr.VolRetention, ed1)); + if (!get_cmd(ua, _("Enter Volume Retention period: "))) { + return 0; + } + if (!string_to_btime(ua->cmd, &mr.VolRetention)) { + bsendmsg(ua, _("Invalid retention period specified.\n")); + break; + } + query = (char *)get_pool_memory(PM_MESSAGE); + Mmsg(&query, "UPDATE Media SET VolRetention=%s WHERE MediaId=%d", + edit_uint64(mr.VolRetention, ed1), mr.MediaId); + if (!db_sql_query(ua->db, query, NULL, NULL)) { + bsendmsg(ua, "%s", db_strerror(ua->db)); + } + free_pool_memory(query); + break; + default: /* Done or error */ + return 0; + } } - strcpy(mr.VolStatus, ua->cmd); - db_update_media_record(ua->db, &mr); return 1; } @@ -900,7 +947,7 @@ static int deletecmd(UAContext *ua, char *cmd) switch (find_arg_keyword(ua, keywords)) { case 0: - delete_media(ua); + delete_volume(ua); return 1; case 1: delete_pool(ua); @@ -910,7 +957,7 @@ static int deletecmd(UAContext *ua, char *cmd) } switch (do_keyword_prompt(ua, _("Choose catalog item to delete"), keywords)) { case 0: - delete_media(ua); + delete_volume(ua); break; case 1: delete_pool(ua); @@ -925,7 +972,7 @@ static int deletecmd(UAContext *ua, char *cmd) /* * Delete media records from database -- dangerous */ -static int delete_media(UAContext *ua) +static int delete_volume(UAContext *ua) { POOL_DBR pr; MEDIA_DBR mr; @@ -1031,7 +1078,7 @@ gotVol: mr.PoolId = pr.PoolId; strcpy(mr.VolStatus, "Append"); mr.Recycle = pr.Recycle; - mr.VolRetention = pr.VolumeRetention; + mr.VolRetention = pr.VolRetention; ua->jcr->store = store; bsendmsg(ua, _("Connecting to Storage daemon %s at %s:%d ...\n"), diff --git a/bacula/src/dird/ua_prune.c b/bacula/src/dird/ua_prune.c index c8c697cb31..b9d9e49241 100644 --- a/bacula/src/dird/ua_prune.c +++ b/bacula/src/dird/ua_prune.c @@ -44,7 +44,7 @@ static int mark_media_purged(UAContext *ua, MEDIA_DBR *mr); */ static char *select_job = "SELECT JobId from Job " - "WHERE StartDay < %s " + "WHERE JobTDate < %s " "AND ClientId=%d " "AND PurgedFiles=0"; @@ -75,7 +75,7 @@ static char *create_deltabs[] = { static char *insert_delcand = "INSERT INTO DelCandidates " "SELECT JobId, PurgedFiles, FileSetId FROM Job " - "WHERE StartDay < %s " + "WHERE JobTDate < %s " "AND ClientId=%d"; /* @@ -86,7 +86,7 @@ static char *insert_delcand = static char *select_del = "SELECT DelCandidates.JobId " "FROM Job,DelCandidates " - "WHERE Job.StartDay >= %s " + "WHERE Job.JobTDate >= %s " "AND Job.ClientId=%d " "AND Job.Level='F' " "AND Job.JobStatus='T' " @@ -197,9 +197,9 @@ int prunecmd(UAContext *ua, char *cmd) MEDIA_DBR mr; static char *keywords[] = { - N_("files"), - N_("jobs"), - N_("volume"), + N_("Files"), + N_("Jobs"), + N_("Volume"), NULL}; if (!open_db(ua)) { return 1; @@ -260,9 +260,7 @@ int prune_files(UAContext *ua, CLIENT *client) struct s_file_del_ctx del; char *query = (char *)get_pool_memory(PM_MESSAGE); int i; - struct tm tm; - uint64_t today, period; - time_t now; + btime_t now, period; CLIENT_DBR cr; char ed1[50]; @@ -274,16 +272,9 @@ int prune_files(UAContext *ua, CLIENT *client) } period = client->FileRetention; - now = time(NULL); - localtime_r(&now, &tm); - today = (uint64_t)(date_encode(tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday) - - date_encode(2000, 1, 1)); + now = (btime_t)time(NULL); - Dmsg3(100, "Today=%d period=%d period=%d\n", (uint32_t)today, (uint32_t)period, - (uint32_t)(period/(3600*24))); - - Mmsg(&query, select_job, - edit_uint64(today - period/(3600*24), ed1), cr.ClientId); + Mmsg(&query, select_job, edit_uint64(now - period, ed1), cr.ClientId); Dmsg1(050, "select sql=%s\n", query); @@ -374,9 +365,7 @@ int prune_jobs(UAContext *ua, CLIENT *client) struct s_count_ctx cnt; char *query = (char *)get_pool_memory(PM_MESSAGE); int i; - struct tm tm; - btime_t today, period; - time_t now; + btime_t now, period; CLIENT_DBR cr; char ed1[50]; @@ -388,14 +377,7 @@ int prune_jobs(UAContext *ua, CLIENT *client) } period = client->JobRetention; - now = time(NULL); - localtime_r(&now, &tm); - today = (btime_t)(date_encode(tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday) - - date_encode(2000, 1, 1)); - - - Dmsg3(050, "Today=%d period=%d period=%d\n", (uint32_t)today, (uint32_t)period, - (uint32_t)(period/(3600*24))); + now = (btime_t)time(NULL); /* Drop any previous temporary tables still there */ drop_temp_tables(ua); @@ -409,7 +391,7 @@ int prune_jobs(UAContext *ua, CLIENT *client) * Select all files that are older than the JobRetention period * and stuff them into the "DeletionCandidates" table. */ - edit_uint64(today - period/(3600*24), ed1); + edit_uint64(now - period, ed1); Mmsg(&query, insert_delcand, ed1, cr.ClientId); if (!db_sql_query(ua->db, query, NULL, (void *)NULL)) { @@ -491,9 +473,7 @@ int prune_volume(UAContext *ua, POOL_DBR *pr, MEDIA_DBR *mr) struct s_file_del_ctx del; int i; JOB_DBR jr; - struct tm tm; - btime_t today, period; - time_t now; + btime_t now, period; memset(&jr, 0, sizeof(jr)); memset(&del, 0, sizeof(del)); @@ -531,21 +511,14 @@ int prune_volume(UAContext *ua, POOL_DBR *pr, MEDIA_DBR *mr) /* Use Volume Retention to purge Jobs and Files */ period = mr->VolRetention; - period = 30 * 3600 *24; /* ****FIXME***** remove */ - now = time(NULL); - localtime_r(&now, &tm); - today = (btime_t)(date_encode(tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday) - - date_encode(2000, 1, 1)); - - Dmsg3(050, "Today=%d period=%d period=%d\n", (uint32_t)today, (uint32_t)period, - (uint32_t)(period/(3600*24))); + now = (btime_t)time(NULL); for (i=0; i < del.num_ids; i++) { jr.JobId = del.JobId[i]; if (!db_get_job_record(ua->db, &jr)) { continue; } - if (jr.StartDay >= (today - period/(3600*24))) { + if (jr.JobTDate >= (now - period)) { continue; } Dmsg1(050, "Delete JobId=%d\n", del.JobId[i]); diff --git a/bacula/src/lib/Makefile.in b/bacula/src/lib/Makefile.in index 8332faf5e0..01d96d8376 100644 --- a/bacula/src/lib/Makefile.in +++ b/bacula/src/lib/Makefile.in @@ -38,8 +38,7 @@ LIBSRCS = alloc.c base64.c bmisc.c bnet.c bnet_server.c \ makepath.c \ md5.c message.c mem_pool.c parse_conf.c \ queue.c rwlock.c save-cwd.c serial.c \ - signal.c smartall.c util.c watchdog.c workq.c - + signal.c smartall.c util.c watchdog.c workq.c # immortal.c filesys.c diff --git a/bacula/src/lib/jcr.c b/bacula/src/lib/jcr.c index aeee5c9fe8..a29454d751 100755 --- a/bacula/src/lib/jcr.c +++ b/bacula/src/lib/jcr.c @@ -118,7 +118,9 @@ static void free_common_jcr(JCR *jcr) break; } pthread_mutex_destroy(&jcr->mutex); + close_msg(jcr); /* close messages for this job */ + /* do this after closing messages */ if (jcr->client_name) { free(jcr->client_name); @@ -134,7 +136,6 @@ static void free_common_jcr(JCR *jcr) free_pool_memory(jcr->VolumeName); jcr->VolumeName = NULL; } - close_msg(jcr); /* close messages for this job */ if (jcr->dir_bsock) { bnet_close(jcr->dir_bsock); diff --git a/bacula/src/lib/message.c b/bacula/src/lib/message.c index 622f5ed0ea..8b88e3006e 100755 --- a/bacula/src/lib/message.c +++ b/bacula/src/lib/message.c @@ -148,6 +148,7 @@ init_msg(void *vjcr) memcpy(dnew, d, sizeof(DEST)); dnew->next = temp_chain; dnew->fd = NULL; + dnew->mail_filename = NULL; temp_chain = dnew; } @@ -189,7 +190,7 @@ void init_console_msg(char *wd) * but in the case of MAIL is a space separated list of * email addresses, ... */ -void add_msg_dest(int dest_code, int msg_type, char *where, char *mail_cmd) +void add_msg_dest(MSGS *msg, int dest_code, int msg_type, char *where, char *mail_cmd) { DEST *d; @@ -230,7 +231,7 @@ void add_msg_dest(int dest_code, int msg_type, char *where, char *mail_cmd) * * Remove a message destination */ -void rem_msg_dest(int dest_code, int msg_type, char *where) +void rem_msg_dest(MSGS *msg, int dest_code, int msg_type, char *where) { DEST *d; @@ -525,14 +526,14 @@ void close_msg(void *vjcr) rem_temp_file: /* Remove temp file */ fclose(d->fd); - make_unique_mail_filename(jcr, &cmd, d); - Dmsg1(200, "unlink: %s\n", cmd); - unlink(cmd); + unlink(d->mail_filename); + free_pool_memory(d->mail_filename); + d->mail_filename = NULL; break; default: break; } - d->fd = 0; + d->fd = NULL; } old = d; /* save pointer to release */ d = d->next; /* point to next buffer */ @@ -555,8 +556,13 @@ void term_msg() if (d->fd) { if (d->dest_code == MD_FILE || d->dest_code == MD_APPEND) { fclose(d->fd); /* close open file descriptor */ + d->fd = NULL; } else if (d->dest_code == MD_MAIL || d->dest_code == MD_MAIL_ON_ERROR) { - pclose(d->fd); /* close open pipe */ + fclose(d->fd); + d->fd = NULL; + unlink(d->mail_filename); + free_pool_memory(d->mail_filename); + d->mail_filename = NULL; } } n = d->next; @@ -646,13 +652,14 @@ void dispatch_message(void *vjcr, int type, int level, char *buf) fputs(buf, d->fd); /* Messages to the operator go one at a time */ pclose(d->fd); + d->fd = NULL; } break; case MD_MAIL: case MD_MAIL_ON_ERROR: Dmsg1(200, "MAIL for following err: %s\n", buf); if (!d->fd) { - char *name = (char *) get_pool_memory(PM_MESSAGE); + char *name = (char *)get_pool_memory(PM_MESSAGE); make_unique_mail_filename(jcr, &name, d); d->fd = fopen(name, "w+"); Dmsg2(100, "Open mail file %d: %s\n", d->fd, name); @@ -661,7 +668,7 @@ void dispatch_message(void *vjcr, int type, int level, char *buf) free_pool_memory(name); break; } - free_pool_memory(name); + d->mail_filename = name; } len = strlen(buf); if (len > d->max_len) { diff --git a/bacula/src/lib/message.h b/bacula/src/lib/message.h index 99e5ed5a0e..6d3d9c5bd8 100644 --- a/bacula/src/lib/message.h +++ b/bacula/src/lib/message.h @@ -57,6 +57,7 @@ typedef struct s_dest { char msg_types[nbytes_for_bits(M_MAX+1)]; /* message type mask */ char *where; /* filename/program name */ char *mail_cmd; /* mail command */ + char *mail_filename; /* unique mail filename */ } DEST; /* Message Destination values for dest field of DEST */ diff --git a/bacula/src/lib/parse_conf.c b/bacula/src/lib/parse_conf.c index 4c2fb5d80b..6978470c24 100755 --- a/bacula/src/lib/parse_conf.c +++ b/bacula/src/lib/parse_conf.c @@ -60,29 +60,29 @@ extern int res_all_size; static int res_locked = 0; /* set when resource chains locked */ /* Forward referenced subroutines */ -static void scan_types(LEX *lc, int dest, char *where, char *cmd); +static void scan_types(LEX *lc, MSGS *msg, int dest, char *where, char *cmd); /* Common Resource definitions */ /* Message resource directives - * name handler store_addr code flags default_value + * name handler value code flags default_value */ struct res_items msgs_items[] = { {"name", store_name, ITEM(res_msgs.hdr.name), 0, 0, 0}, {"description", store_str, ITEM(res_msgs.hdr.desc), 0, 0, 0}, {"mailcommand", store_str, ITEM(res_msgs.mail_cmd), 0, 0, 0}, {"operatorcommand", store_str, ITEM(res_msgs.operator_cmd), 0, 0, 0}, - {"syslog", store_msgs, NULL, MD_SYSLOG, 0, 0}, - {"mail", store_msgs, NULL, MD_MAIL, 0, 0}, - {"mailonerror", store_msgs, NULL, MD_MAIL_ON_ERROR, 0, 0}, - {"file", store_msgs, NULL, MD_FILE, 0, 0}, - {"append", store_msgs, NULL, MD_APPEND, 0, 0}, - {"stdout", store_msgs, NULL, MD_STDOUT, 0, 0}, - {"stderr", store_msgs, NULL, MD_STDERR, 0, 0}, - {"director", store_msgs, NULL, MD_DIRECTOR, 0, 0}, - {"console", store_msgs, NULL, MD_CONSOLE, 0, 0}, - {"operator", store_msgs, NULL, MD_OPERATOR, 0, 0}, + {"syslog", store_msgs, ITEM(res_msgs), MD_SYSLOG, 0, 0}, + {"mail", store_msgs, ITEM(res_msgs), MD_MAIL, 0, 0}, + {"mailonerror", store_msgs, ITEM(res_msgs), MD_MAIL_ON_ERROR, 0, 0}, + {"file", store_msgs, ITEM(res_msgs), MD_FILE, 0, 0}, + {"append", store_msgs, ITEM(res_msgs), MD_APPEND, 0, 0}, + {"stdout", store_msgs, ITEM(res_msgs), MD_STDOUT, 0, 0}, + {"stderr", store_msgs, ITEM(res_msgs), MD_STDERR, 0, 0}, + {"director", store_msgs, ITEM(res_msgs), MD_DIRECTOR, 0, 0}, + {"console", store_msgs, ITEM(res_msgs), MD_CONSOLE, 0, 0}, + {"operator", store_msgs, ITEM(res_msgs), MD_OPERATOR, 0, 0}, {NULL, NULL, NULL, 0} }; @@ -182,7 +182,7 @@ void store_msgs(LEX *lc, struct res_items *item, int index, int pass) case MD_STDERR: case MD_SYSLOG: /* syslog */ case MD_CONSOLE: - scan_types(lc, item->code, NULL, NULL); + scan_types(lc, (MSGS *)(item->value), item->code, NULL, NULL); break; case MD_OPERATOR: /* send to operator */ case MD_DIRECTOR: /* send to Director */ @@ -220,7 +220,7 @@ void store_msgs(LEX *lc, struct res_items *item, int index, int pass) break; } Dmsg1(200, "mail_cmd=%s\n", cmd); - scan_types(lc, item->code, dest, cmd); + scan_types(lc, (MSGS *)(item->value), item->code, dest, cmd); free_pool_memory(dest); Dmsg0(200, "done with dest codes\n"); break; @@ -240,7 +240,7 @@ void store_msgs(LEX *lc, struct res_items *item, int index, int pass) if (token != T_EQUALS) { scan_err1(lc, "expected an =, got: %s", lc->str); } - scan_types(lc, item->code, dest, NULL); + scan_types(lc, (MSGS *)(item->value), item->code, dest, NULL); free_pool_memory(dest); Dmsg0(200, "done with dest codes\n"); break; @@ -261,7 +261,7 @@ void store_msgs(LEX *lc, struct res_items *item, int index, int pass) * (WARNING, ERROR, FATAL, INFO, ...) with an appropriate * destination (MAIL, FILE, OPERATOR, ...) */ -static void scan_types(LEX *lc, int dest_code, char *where, char *cmd) +static void scan_types(LEX *lc, MSGS *msg, int dest_code, char *where, char *cmd) { int token, i, found, quit, is_not; int msg_type; @@ -293,13 +293,13 @@ static void scan_types(LEX *lc, int dest_code, char *where, char *cmd) if (msg_type == M_MAX+1) { /* all? */ for (i=1; i<=M_MAX; i++) { /* yes set all types */ - add_msg_dest(dest_code, i, where, cmd); + add_msg_dest(msg, dest_code, i, where, cmd); } } else { if (is_not) { - rem_msg_dest(dest_code, msg_type, where); + rem_msg_dest(msg, dest_code, msg_type, where); } else { - add_msg_dest(dest_code, msg_type, where, cmd); + add_msg_dest(msg, dest_code, msg_type, where, cmd); } } if (lc->ch != ',') { @@ -586,11 +586,8 @@ void store_size(LEX *lc, struct res_items *item, int index, int pass) /* Store a time period in seconds */ void store_time(LEX *lc, struct res_items *item, int index, int pass) { - int token, i, ch; + int token; btime_t value; - int mod[] = {'*', 's', 'm', 'h', 'd', 'w', 'o', 'q', 'y', 0}; - int mult[] = {1, 60, 60*60, 60*60*24, 60*60*24*7, 60*60*24*30, - 60*60*24*91, 60*60*24*365}; token = lex_get_token(lc); errno = 0; @@ -604,29 +601,10 @@ void store_time(LEX *lc, struct res_items *item, int index, int pass) break; case T_IDENTIFIER: case T_STRING: - /* Look for modifier */ - ch = lc->str[lc->str_len - 1]; - i = 0; - if (ISALPHA(ch)) { - if (ISUPPER(ch)) { - ch = tolower(ch); - } - while (mod[++i] != 0) { - if (ch == mod[i]) { - lc->str_len--; - lc->str[lc->str_len] = 0; /* strip modifier */ - break; - } - } - } - if (mod[i] == 0 || !is_a_number(lc->str)) { + if (!string_to_btime(lc->str, &value)) { scan_err1(lc, "expected a time period, got: %s", lc->str); } - value = (btime_t)strtod(lc->str, NULL); - if (errno != 0 || value < 0) { - scan_err1(lc, "expected a time period, got: %s", lc->str); - } - *(btime_t *)(item->value) = value * mult[i]; + *(btime_t *)(item->value) = value; break; default: scan_err1(lc, "expected a time period, got: %s", lc->str); diff --git a/bacula/src/lib/protos.h b/bacula/src/lib/protos.h index 2f0ec19bb0..93737d5fa3 100644 --- a/bacula/src/lib/protos.h +++ b/bacula/src/lib/protos.h @@ -22,128 +22,130 @@ */ /* base64.c */ -void base64_init __PROTO((void)); -int to_base64 __PROTO((intmax_t value, char *where)); -int from_base64 __PROTO((intmax_t *value, char *where)); -void encode_stat __PROTO((char *buf, struct stat *statp)); -void decode_stat __PROTO((char *buf, struct stat *statp)); -int bin_to_base64 __PROTO((char *buf, char *bin, int len)); +void base64_init __PROTO((void)); +int to_base64 __PROTO((intmax_t value, char *where)); +int from_base64 __PROTO((intmax_t *value, char *where)); +void encode_stat __PROTO((char *buf, struct stat *statp)); +void decode_stat __PROTO((char *buf, struct stat *statp)); +int bin_to_base64 __PROTO((char *buf, char *bin, int len)); /* bmisc.c */ -void *b_malloc (char *file, int line, size_t size); +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, ...); -int create_pid_file (char *dir, char *progname, int port, char *errmsg); -int delete_pid_file (char *dir, char *progname, int port); +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, ...); +int create_pid_file (char *dir, char *progname, int port, char *errmsg); +int delete_pid_file (char *dir, char *progname, int port); /* bnet.c */ -int32_t bnet_recv __PROTO((BSOCK *bsock)); -int bnet_send __PROTO((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 __PROTO((BSOCK *bsock)); -BSOCK * init_bsock __PROTO((int sockfd, char *who, char *ip, int port)); -BSOCK * dup_bsock __PROTO((BSOCK *bsock)); -void term_bsock __PROTO((BSOCK *bsock)); -char * bnet_strerror __PROTO((BSOCK *bsock)); -char * bnet_sig_to_ascii __PROTO((BSOCK *bsock)); -int bnet_wait_data __PROTO((BSOCK *bsock, int sec)); +int32_t bnet_recv __PROTO((BSOCK *bsock)); +int bnet_send __PROTO((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 __PROTO((BSOCK *bsock)); +BSOCK * init_bsock __PROTO((int sockfd, char *who, char *ip, int port)); +BSOCK * dup_bsock __PROTO((BSOCK *bsock)); +void term_bsock __PROTO((BSOCK *bsock)); +char * bnet_strerror __PROTO((BSOCK *bsock)); +char * bnet_sig_to_ascii __PROTO((BSOCK *bsock)); +int bnet_wait_data __PROTO((BSOCK *bsock, int sec)); /* 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); /* create_file.c */ int create_file(void *jcr, char *fname, char *ofile, char *lname, - int type, struct stat *statp, int *ofd); + int type, struct stat *statp, int *ofd); int set_statp(void *jcr, char *fname, char *ofile, char *lname, int type, - struct stat *statp); + struct stat *statp); /* crc32.c */ uint32_t bcrc32(uint8_t *buf, int len); /* daemon.c */ -void daemon_start __PROTO(()); +void daemon_start __PROTO(()); /* lex.c */ -LEX * lex_close_file __PROTO((LEX *lf)); -LEX * lex_open_file __PROTO((LEX *lf, char *fname)); -int lex_get_char __PROTO((LEX *lf)); -void lex_unget_char __PROTO((LEX *lf)); -char * lex_tok_to_str __PROTO((int token)); -int lex_get_token __PROTO((LEX *lf)); +LEX * lex_close_file __PROTO((LEX *lf)); +LEX * lex_open_file __PROTO((LEX *lf, char *fname)); +int lex_get_char __PROTO((LEX *lf)); +void lex_unget_char __PROTO((LEX *lf)); +char * lex_tok_to_str __PROTO((int token)); +int lex_get_token __PROTO((LEX *lf)); /* makepath.c */ int make_path( - void *jcr, - const char *argpath, - int mode, - int parent_mode, - uid_t owner, - gid_t group, - int preserve_existing, - char *verbose_fmt_string); + void *jcr, + const char *argpath, + int mode, + int parent_mode, + uid_t owner, + gid_t group, + int preserve_existing, + char *verbose_fmt_string); /* message.c */ -void my_name_is __PROTO((int argc, char *argv[], char *name)); -void init_msg __PROTO((void *jcr)); -void term_msg __PROTO((void)); -void close_msg __PROTO((void *jcr)); -void add_msg_dest __PROTO((int dest, int type, char *where, char *dest_code)); -void rem_msg_dest __PROTO((int dest, int type, char *where)); -void Jmsg (void *jcr, int type, int level, char *fmt, ...); -void dispatch_message __PROTO((void *jcr, int type, int level, char *buf)); -void init_console_msg __PROTO((char *wd)); +void my_name_is __PROTO((int argc, char *argv[], char *name)); +void init_msg __PROTO((void *jcr)); +void term_msg __PROTO((void)); +void close_msg __PROTO((void *jcr)); +void add_msg_dest __PROTO((MSGS *msg, int dest, int type, char *where, char *dest_code)); +void rem_msg_dest __PROTO((MSGS *msg, int dest, int type, char *where)); +void Jmsg (void *jcr, int type, int level, char *fmt, ...); +void dispatch_message __PROTO((void *jcr, int type, int level, char *buf)); +void init_console_msg __PROTO((char *wd)); /* bnet_server.c */ -void bnet_thread_server(int port, int max_clients, workq_t *client_wq, - void handle_client_request(void *bsock)); -void bnet_server __PROTO((int port, void handle_client_request(BSOCK *bsock))); -int net_connect __PROTO((int port)); -BSOCK * bnet_bind __PROTO((int port)); -BSOCK * bnet_accept __PROTO((BSOCK *bsock, char *who)); +void bnet_thread_server(int port, int max_clients, workq_t *client_wq, + void handle_client_request(void *bsock)); +void bnet_server __PROTO((int port, void handle_client_request(BSOCK *bsock))); +int net_connect __PROTO((int port)); +BSOCK * bnet_bind __PROTO((int port)); +BSOCK * bnet_accept __PROTO((BSOCK *bsock, char *who)); /* signal.c */ -void init_signals __PROTO((void terminate(int sig))); -void init_stack_dump (void); +void init_signals __PROTO((void terminate(int sig))); +void init_stack_dump (void); /* util.c */ -void lcase __PROTO((char *str)); -void bash_spaces __PROTO((char *str)); -void unbash_spaces __PROTO((char *str)); -void strip_trailing_junk __PROTO((char *str)); -void strip_trailing_slashes __PROTO((char *dir)); -int skip_spaces __PROTO((char **msg)); -int skip_nonspaces __PROTO((char **msg)); -int fstrsch __PROTO((char *a, char *b)); -char * encode_time __PROTO((time_t time, char *buf)); -char * encode_mode __PROTO((mode_t mode, char *buf)); -char * edit_uint64_with_commas __PROTO((uint64_t val, char *buf)); -char * add_commas __PROTO((char *val, char *buf)); -char * edit_uint64 (uint64_t val, char *buf); -int do_shell_expansion (char *name); -int is_a_number (const char *num); +void lcase __PROTO((char *str)); +void bash_spaces __PROTO((char *str)); +void unbash_spaces __PROTO((char *str)); +void strip_trailing_junk __PROTO((char *str)); +void strip_trailing_slashes __PROTO((char *dir)); +int skip_spaces __PROTO((char **msg)); +int skip_nonspaces __PROTO((char **msg)); +int fstrsch __PROTO((char *a, char *b)); +char * encode_time __PROTO((time_t time, char *buf)); +char * encode_mode __PROTO((mode_t mode, char *buf)); +char * edit_uint64_with_commas __PROTO((uint64_t val, char *buf)); +char * add_commas __PROTO((char *val, char *buf)); +char * edit_uint64 (uint64_t val, char *buf); +int do_shell_expansion (char *name); +int is_a_number (const char *num); +int string_to_btime(char *str, btime_t *value); +char *edit_btime(btime_t val, char *buf); /* - *void print_ls_output __PROTO((char *fname, char *lname, int type, struct stat *statp)); + *void print_ls_output __PROTO((char *fname, char *lname, int type, struct stat *statp)); */ /* watchdog.c */ diff --git a/bacula/src/lib/util.c b/bacula/src/lib/util.c index aaa7d72679..1235e7ffb1 100644 --- a/bacula/src/lib/util.c +++ b/bacula/src/lib/util.c @@ -32,6 +32,73 @@ * */ +/* + * Convert a string to btime_t (64 bit seconds) + * Returns 0: if error + 1: if OK, and value stored in value + */ +int string_to_btime(char *str, btime_t *value) +{ + int i, ch, len; + btime_t val; + static int mod[] = {'*', 's', 'm', 'h', 'd', 'w', 'o', 'q', 'y', 0}; + static int mult[] = {1, 1, 60, 60*60, 60*60*24, 60*60*24*7, 60*60*24*30, + 60*60*24*91, 60*60*24*365}; + + /* Look for modifier */ + len = strlen(str); + ch = str[len - 1]; + i = 0; + if (ISALPHA(ch)) { + if (ISUPPER(ch)) { + ch = tolower(ch); + } + while (mod[++i] != 0) { + if (ch == mod[i]) { + len--; + str[len] = 0; /* strip modifier */ + break; + } + } + } + if (mod[i] == 0 || !is_a_number(str)) { + return 0; + } + val = (btime_t)strtod(str, NULL); + if (errno != 0 || val < 0) { + return 0; + } + *value = val * mult[i]; + return 1; + +} + +char *edit_btime(btime_t val, char *buf) +{ + char mybuf[30]; + static int mult[] = {60*60*24*365, 60*60*24*30, 60*60*24, 60*60, 60}; + static char *mod[] = {"year", "month", "day", "hour", "min"}; + int i; + uint32_t times; + + *buf = 0; + for (i=0; i<5; i++) { + times = val / mult[i]; + if (times > 0) { + val = val - (btime_t)times * mult[i]; + sprintf(mybuf, "%d %s%s ", times, mod[i], times>1?"s":""); + strcat(buf, mybuf); + } + } + if (val == 0 && strlen(buf) == 0) { + strcat(buf, "0 secs"); + } else if (val != 0) { + sprintf(mybuf, "%d sec%s", (uint32_t)val, val>1?"s":""); + strcat(buf, mybuf); + } + return buf; +} + /* * Check if specified string is a number or not. * Taken from SQLite, cool, thanks. diff --git a/bacula/src/stored/bextract.c b/bacula/src/stored/bextract.c index 7a20cf1000..a3c21f92f1 100644 --- a/bacula/src/stored/bextract.c +++ b/bacula/src/stored/bextract.c @@ -121,7 +121,7 @@ int main (int argc, char *argv[]) * Ensure that every message is always printed */ for (i=1; i<=M_MAX; i++) { - add_msg_dest(MD_STDOUT, i, NULL, NULL); + add_msg_dest(NULL, MD_STDOUT, i, NULL, NULL); } jcr = new_jcr(sizeof(JCR), my_free_jcr); diff --git a/bacula/src/stored/bls.c b/bacula/src/stored/bls.c index de60d1af7f..5fa23b504a 100644 --- a/bacula/src/stored/bls.c +++ b/bacula/src/stored/bls.c @@ -148,7 +148,7 @@ int main (int argc, char *argv[]) * Ensure that every message is always printed */ for (i=1; i<=M_MAX; i++) { - add_msg_dest(MD_STDOUT, i, NULL, NULL); + add_msg_dest(NULL, MD_STDOUT, i, NULL, NULL); } /* Try default device */ diff --git a/bacula/src/stored/bscan.c b/bacula/src/stored/bscan.c index 7804241fd5..6738d866c8 100644 --- a/bacula/src/stored/bscan.c +++ b/bacula/src/stored/bscan.c @@ -87,7 +87,7 @@ int main (int argc, char *argv[]) * Ensure that every message is always printed */ for (i=1; i<=M_MAX; i++) { - add_msg_dest(MD_STDOUT, i, NULL, NULL); + add_msg_dest(NULL, MD_STDOUT, i, NULL, NULL); } jcr = new_jcr(sizeof(JCR), my_free_jcr); diff --git a/bacula/src/stored/btape.c b/bacula/src/stored/btape.c index 8aa3b4ba1d..b6e606a2c9 100644 --- a/bacula/src/stored/btape.c +++ b/bacula/src/stored/btape.c @@ -164,7 +164,7 @@ int main(int argc, char *argv[]) * Ensure that every message is always printed */ for (i=1; i<=M_MAX; i++) { - add_msg_dest(MD_STDOUT, i, NULL, NULL); + add_msg_dest(NULL, MD_STDOUT, i, NULL, NULL); } diff --git a/bacula/src/version.h b/bacula/src/version.h index 7021c25103..625956f409 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -1,8 +1,8 @@ /* */ #define VERSION "1.19" #define VSTRING "1" -#define DATE "28 April 2002" -#define LSMDATE "28Apr02" +#define DATE "08 May 2002" +#define LSMDATE "08May02" /* Debug flags */ #define DEBUG 1 -- 2.39.2