]> git.sur5r.net Git - bacula/bacula/commitdiff
First cut 1.23 -- kes07Jul02
authorKern Sibbald <kern@sibbald.com>
Sun, 7 Jul 2002 14:41:19 +0000 (14:41 +0000)
committerKern Sibbald <kern@sibbald.com>
Sun, 7 Jul 2002 14:41:19 +0000 (14:41 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@54 91ce42f0-d328-0410-95d8-f526ca767f89

78 files changed:
bacula/ChangeLog
bacula/Makefile.in
bacula/autoconf/aclocal.m4
bacula/autoconf/configure.in
bacula/configure
bacula/src/baconfig.h
bacula/src/cats/Makefile.in
bacula/src/cats/bdb_find.c
bacula/src/cats/bdb_update.c
bacula/src/cats/cats.h
bacula/src/cats/create_bdb_database.in [new file with mode: 0644]
bacula/src/cats/create_mysql_database.in
bacula/src/cats/create_sqlite_database.in [new file with mode: 0644]
bacula/src/cats/drop_bdb_tables.in [new file with mode: 0644]
bacula/src/cats/make_bdb_tables.in [new file with mode: 0644]
bacula/src/cats/make_mysql_tables.in
bacula/src/cats/make_sqlite_tables.in
bacula/src/cats/mysql.c
bacula/src/cats/protos.h
bacula/src/cats/sql_create.c
bacula/src/cats/sql_find.c
bacula/src/cats/sql_get.c
bacula/src/cats/sql_update.c
bacula/src/cats/sqlite.c
bacula/src/console/console.c
bacula/src/count-lines
bacula/src/dird/autoprune.c
bacula/src/dird/backup.c
bacula/src/dird/catreq.c
bacula/src/dird/dird.c
bacula/src/dird/dird_conf.c
bacula/src/dird/dird_conf.h
bacula/src/dird/job.c
bacula/src/dird/msgchan.c
bacula/src/dird/protos.h
bacula/src/dird/ua.h
bacula/src/dird/ua_cmds.c
bacula/src/dird/ua_prune.c
bacula/src/dird/ua_run.c
bacula/src/dird/ua_server.c
bacula/src/dird/verify.c
bacula/src/filed/Makefile.in
bacula/src/filed/backup.c
bacula/src/filed/filed.c
bacula/src/filed/job.c
bacula/src/filed/protos.h
bacula/src/filed/restore.c
bacula/src/filed/verify.c
bacula/src/filed/verify_vol.c [new file with mode: 0644]
bacula/src/findlib/find.h
bacula/src/findlib/find_one.c
bacula/src/findlib/match.c
bacula/src/jcr.h
bacula/src/lib/Makefile.in
bacula/src/lib/bnet.c
bacula/src/lib/bnet_pkt.c [new file with mode: 0644]
bacula/src/lib/bsock.h
bacula/src/lib/message.c
bacula/src/lib/parse_conf.c
bacula/src/stored/append.c
bacula/src/stored/askdir.c
bacula/src/stored/bextract.c
bacula/src/stored/bls.c
bacula/src/stored/bscan.c
bacula/src/stored/bsr.h
bacula/src/stored/btape.c
bacula/src/stored/dev.c
bacula/src/stored/dev.h
bacula/src/stored/device.c
bacula/src/stored/dircmd.c
bacula/src/stored/job.c
bacula/src/stored/label.c
bacula/src/stored/match_bsr.c
bacula/src/stored/parse_bsr.c
bacula/src/stored/read.c
bacula/src/stored/stored.c
bacula/src/stored/stored_conf.c
bacula/src/version.h

index d0ab5fdec5cf7a539746c2fefda05f92663a7554..2257327e7b67f781ab37e780d06a2e584705809d 100644 (file)
@@ -1,3 +1,66 @@
+2002-mm-dd Release 1.23
+  From kes07Jul02
+- This documents what I did while on vacation. 
+- A fair amount of documentation.
+- Implemented Verify Volume to Catalog (needs renaming)
+- Modified the database to include new MarkId field as
+  well as Counters. Database level is incremented from 1 to  2.
+- Added first cut of managing autochangers by implementing Slot in DB.
+- Fixed a good number of M_ERROR messages to be M_FATAL where appropriate.
+  Also converted a number of Emsg() to Jmsg() permitting better Job error
+  messages.
+- First cut at implementing a general packet passing mechanism for bsock
+  to replace printf and sscanf for passing data.     
+- Made make_xxx_tables and drop_xxx_tables and create_xxx_database
+  for bdb as well as sqlite. With this each database has the
+  same set of scripts (with the exception that MySQL has grant_privileges).
+- Modified Makefile to only install the database scripts for the
+  database that you are using.
+- Updated the pdf script to include all the html files.
+- Did quite a lot of documentation.
+- Made Bacula compile correctly with DEBUG turned off.
+- Implemented Pmsg() macros that permit using the debug print
+  routines even with DEBUG off.
+- Updated job_cancelled() macro to handle JS_FatalError.
+- Changed db_find_last_full_verify() to db_find_last_jobid(). This
+  permits working with Verify Volume to Catalog.
+- Removed TRANSACTION code from incrementing NextId for SQLite. 
+- Implemented quick and dirty (not fully functional code) so that
+  console program does not die if ctl-Z is entered. 
+- Cleaned up backup.c a bit adding a bail_out goto to ensure proper
+  handling of errors with minimum code.
+- Added passing Slot back and forth to Storage daemon with Volume info.
+- Implemented Slot in Media record in DB.
+- Implemented first cut of Counter resource in dird_conf.c. A counter
+  resource is part of the Pool resource.
+- Implemented necessary database record. However, the resource doesn't
+  yet create a DB record.
+- Implemented onefs (One File System) and recurse options on Include
+  resource.
+- Implemented autopruning of Verify and Restore Jobs.
+- Did a better job of calculating thread_concurrency() for Sun systems.
+  This permits better multi-threading allowing all the threads to run
+  at the same time.
+- Implemented a wait_for_storage_daemon_termination(), which is used by
+  backup and verify volume.
+- Clarified a number of UA prompts, and add feedback where certain commands
+  completed but printed nothing. (More work to be done here).
+- Added a pile of new code to implement Verify Volume to Catalog. It is sort
+  of a hybrid of "restore" and "verify" in that it actually reads the tape,
+  then compares it to the catalog.  Need Verify Volume to Client.
+- Added a good number of checks for job_cancelled() this should permit
+  quicker and more reliable cancelling of jobs.
+- Fixed one bug in restore where I used ofile instead of lname, which means
+  that if the lname was too long, the memory was not properly reallocated.
+- Cleaned up find_one.c in findlib quite a bit.
+- Link smtp static so that it works even if the libraries are messed up.
+- If mail host is not found, retry with local host in smtp.
+- Added slot and stream to the bootstrap record processing.
+- Do offline on tape cartrige for unmount command. This can be turned off
+  by the user in the config file. OffLineOnUnmount in Device resource.
+- Implemented AutoChanger = yes/no in Device resource.
+
+
 2002-07-07 Release 1.22
 - All the basic Restore code to handle the boostrap file is
   now implemented with the exception of the Console Restore command.
index 4b2914644213f8e15ed53dd4ff63ebde59950a0f..6ea2fb2cbec4ba4d0f84f027c03cd8955ad6c027 100755 (executable)
@@ -123,10 +123,13 @@ Makefiles:
        chmod 755 src/dird/btraceback src/filed/btraceback
        chmod 755 src/stored/btraceback
        chmod 755 src/cats/make_mysql_tables src/cats/drop_mysql_tables
+       chmod 755 src/cats/make_sqlite_tables src/cats/drop_sqlite_tables
+       chmod 755 src/cats/make_bdb_tables src/cats/drop_bdb_tables
        chmod 755 src/cats/make_test_tables src/cats/drop_test_tables
        chmod 755 src/cats/create_mysql_database
+       chmod 755 src/cats/create_sqlite_database
+       chmod 755 src/cats/create_bdb_database
        chmod 755 src/cats/grant_mysql_privileges
-       chmod 755 src/cats/make_sqlite_tables
 
 clean:
        @for I in ${subdirs}; \
index 017f8536f7dd6f2aa993b2b46a56360ee21db597..46e59b17013ddbcf66222e806c0d575987d9e8d1 100644 (file)
@@ -230,7 +230,6 @@ AC_MSG_RESULT(" ")
 AC_DEFUN(BA_CHECK_MYSQL_DB,
 [
 have_db=no
-db_name=none
 AC_MSG_CHECKING(for MySQL support)
 AC_ARG_WITH(mysql,
 [
@@ -288,6 +287,7 @@ Which one DBMS do you want to use (please select only one):
     have_db=yes
     support_mysql=yes
     db_name=MySQL
+    DB_NAME=mysql
 
   else
         AC_MSG_RESULT(no)
@@ -305,7 +305,6 @@ AC_SUBST(SQL_BINDIR)
 AC_DEFUN(BA_CHECK_SQLITE_DB,
 [
 have_db=no
-db_name=none
 AC_MSG_CHECKING(for SQLite support)
 AC_ARG_WITH(sqlite,
 [
@@ -347,6 +346,7 @@ Which one DBMS do you want to use (please select only one):
     have_db=yes
     support_sqlite=yes
     db_name=SQLite
+    DB_NAME=sqlite
 
   else
         AC_MSG_RESULT(no)
@@ -1173,4 +1173,3 @@ AC_DEFUN([GNOME_ORBIT_HOOK],[
 AC_DEFUN([GNOME_ORBIT_CHECK], [
         GNOME_ORBIT_HOOK([],failure)
 ])
-
index 1fd35375c5ae26f87e85da435f0bf227cd322ba0..bf84950b79f3c9f426b36556505ba4ee1d3ab46f 100644 (file)
@@ -140,6 +140,8 @@ support_mysql=no
 support_sqlite=no
 support_smartalloc=yes
 cats=
+db_name=Internal
+DB_NAME=bdb
 
 dnl# --------------------------------------------------------------------------
 dnl# CHECKING COMMAND LINE OPTIONS
@@ -622,7 +624,6 @@ AC_SUBST(sd_password)
 
 
 
-AC_SUBST(cats)
 
 # ------------------------------------------------
 # Bacula check for various SQL database engines
@@ -635,6 +636,8 @@ BA_CHECK_MYSQL_DB
 # ------------------------------------------------
 BA_CHECK_SQLITE_DB
 
+AC_SUBST(cats)
+AC_SUBST(DB_NAME)
 
 AC_DEFINE(PROTOTYPES)
 
@@ -1183,7 +1186,11 @@ AC_OUTPUT([autoconf/Make.common \
           src/cats/grant_mysql_privileges \
           src/cats/make_sqlite_tables \
           src/cats/drop_sqlite_tables \
+          src/cats/create_sqlite_database \
           src/cats/sqlite \
+          src/cats/create_bdb_database \
+          src/cats/make_bdb_tables \
+          src/cats/drop_bdb_tables \
           src/findlib/Makefile \
           $PFILES ],  
          [(echo "Doing make of dependencies"; make depend;) ]
@@ -1200,8 +1207,10 @@ 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 src/cats/drop_sqlite_tables 
+chmod 755 src/cats/create_sqlite_database
 chmod 755 src/cats/sqlite
-
+chmod 755 src/cats/make_bdb_tables src/cats/drop_bdb_tables 
+chmod 755 src/cats/create_bdb_database
 
 echo "
 Configuration on `date`:
index cc8ee3a18dd3a4b5a1f42c8d282dcc896f94ca80..d2d0104244dac296e2bceb9633e3a4361d8e4bf9 100755 (executable)
@@ -2304,6 +2304,8 @@ support_mysql=no
 support_sqlite=no
 support_smartalloc=yes
 cats=
+db_name=Internal
+DB_NAME=bdb
 
 # Check whether --enable-everything or --disable-everything was given.
 if test "${enable_everything+set}" = set; then
@@ -2384,7 +2386,7 @@ fi
             # Extract the first word of "gnome-config", so it can be a program name with args.
 set dummy gnome-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2388: checking for $ac_word" >&5
+echo "configure:2390: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GNOME_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2421,7 +2423,7 @@ fi
               no_gnome_config="yes"
             else
               echo $ac_n "checking if $GNOME_CONFIG works""... $ac_c" 1>&6
-echo "configure:2425: checking if $GNOME_CONFIG works" >&5
+echo "configure:2427: checking if $GNOME_CONFIG works" >&5
               if $GNOME_CONFIG --libs-only-l gnome >/dev/null 2>&1; then
                 echo "$ac_t""yes" 1>&6
                 
@@ -2429,7 +2431,7 @@ echo "configure:2425: checking if $GNOME_CONFIG works" >&5
         # Extract the first word of "orbit-config", so it can be a program name with args.
 set dummy orbit-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2433: checking for $ac_word" >&5
+echo "configure:2435: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_ORBIT_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2465,7 +2467,7 @@ fi
         # Extract the first word of "orbit-idl", so it can be a program name with args.
 set dummy orbit-idl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2469: checking for $ac_word" >&5
+echo "configure:2471: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_ORBIT_IDL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2499,7 +2501,7 @@ else
 fi
 
         echo $ac_n "checking for working ORBit environment""... $ac_c" 1>&6
-echo "configure:2503: checking for working ORBit environment" >&5
+echo "configure:2505: checking for working ORBit environment" >&5
 if eval "test \"`echo '$''{'gnome_cv_orbit_found'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2535,7 +2537,7 @@ fi
         fi
 
         echo $ac_n "checking for gnorba libraries""... $ac_c" 1>&6
-echo "configure:2539: checking for gnorba libraries" >&5
+echo "configure:2541: checking for gnorba libraries" >&5
 if eval "test \"`echo '$''{'gnome_cv_gnorba_found'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2599,7 +2601,7 @@ fi
         
             if test "$no_gnome_config" = "yes"; then
               echo $ac_n "checking for gnomeConf.sh file in $gnome_prefix""... $ac_c" 1>&6
-echo "configure:2603: checking for gnomeConf.sh file in $gnome_prefix" >&5
+echo "configure:2605: checking for gnomeConf.sh file in $gnome_prefix" >&5
               if test -f $gnome_prefix/gnomeConf.sh; then
                 echo "$ac_t""found" 1>&6
                 echo "loading gnome configuration from" \
@@ -2619,7 +2621,7 @@ echo "configure:2603: checking for gnomeConf.sh file in $gnome_prefix" >&5
           n=""
           for i in $n; do
             echo $ac_n "checking extra library \"$i\"""... $ac_c" 1>&6
-echo "configure:2623: checking extra library \"$i\"" >&5
+echo "configure:2625: checking extra library \"$i\"" >&5
             case $i in 
               applets)
                 
@@ -2700,17 +2702,17 @@ if test "${with_readline+set}" = set; then
          fi
          ac_safe=`echo "$with_readline/readline.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $with_readline/readline.h""... $ac_c" 1>&6
-echo "configure:2704: checking for $with_readline/readline.h" >&5
+echo "configure:2706: checking for $with_readline/readline.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
-#line 2709 "configure"
+#line 2711 "configure"
 #include "confdefs.h"
 #include <$with_readline/readline.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2714: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2716: \"$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*
@@ -2749,17 +2751,17 @@ else
        # check for standard readline library
        ac_safe=`echo "/usr/include/readline/readline.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for /usr/include/readline/readline.h""... $ac_c" 1>&6
-echo "configure:2753: checking for /usr/include/readline/readline.h" >&5
+echo "configure:2755: checking for /usr/include/readline/readline.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
-#line 2758 "configure"
+#line 2760 "configure"
 #include "confdefs.h"
 #include </usr/include/readline/readline.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2763: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2765: \"$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*
@@ -2816,12 +2818,12 @@ MAKE_SHELL=/bin/sh
 
 
 echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6
-echo "configure:2820: checking whether stat file-mode macros are broken" >&5
+echo "configure:2822: 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 <<EOF
-#line 2825 "configure"
+#line 2827 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -2876,12 +2878,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:2880: checking for $ac_hdr that defines DIR" >&5
+echo "configure:2882: 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 <<EOF
-#line 2885 "configure"
+#line 2887 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_hdr>
@@ -2889,7 +2891,7 @@ int main() {
 DIR *dirp = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:2893: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2895: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_dirent_$ac_safe=yes"
 else
@@ -2914,7 +2916,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:2918: checking for opendir in -ldir" >&5
+echo "configure:2920: 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
@@ -2922,7 +2924,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldir  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2926 "configure"
+#line 2928 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2933,7 +2935,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:2937: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2939: \"$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
@@ -2955,7 +2957,7 @@ fi
 
 else
 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:2959: checking for opendir in -lx" >&5
+echo "configure:2961: 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
@@ -2963,7 +2965,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lx  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2967 "configure"
+#line 2969 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2974,7 +2976,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:2978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2980: \"$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
@@ -3000,12 +3002,12 @@ fi
 for ac_func in strcasecmp select setenv putenv tcgetattr setlocale lstat lchown
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3004: checking for $ac_func" >&5
+echo "configure:3006: 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 <<EOF
-#line 3009 "configure"
+#line 3011 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3028,7 +3030,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3034: \"$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
@@ -3058,12 +3060,12 @@ done
 #    EXTRAOBJ="$EXTRAOBJ lib/getopt.o lib/getopt1.o"])
 
 echo $ac_n "checking for getopt_long""... $ac_c" 1>&6
-echo "configure:3062: checking for getopt_long" >&5
+echo "configure:3064: checking for getopt_long" >&5
 if eval "test \"`echo '$''{'ac_cv_func_getopt_long'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3067 "configure"
+#line 3069 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char getopt_long(); below.  */
@@ -3086,7 +3088,7 @@ getopt_long();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3090: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3092: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_getopt_long=yes"
 else
@@ -3111,7 +3113,7 @@ fi
 
 
 echo $ac_n "checking for working strcoll""... $ac_c" 1>&6
-echo "configure:3115: checking for working strcoll" >&5
+echo "configure:3117: checking for working strcoll" >&5
 if eval "test \"`echo '$''{'ac_cv_func_strcoll_works'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3119,7 +3121,7 @@ else
   ac_cv_func_strcoll_works=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 3123 "configure"
+#line 3125 "configure"
 #include "confdefs.h"
 #include <string.h>
 main ()
@@ -3129,7 +3131,7 @@ main ()
        strcoll ("123", "456") >= 0);
 }
 EOF
-if { (eval echo configure:3133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3135: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_strcoll_works=yes
 else
@@ -3157,17 +3159,17 @@ for ac_hdr in varargs.h \
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3161: checking for $ac_hdr" >&5
+echo "configure:3163: 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
-#line 3166 "configure"
+#line 3168 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3171: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3173: \"$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*
@@ -3219,17 +3221,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:3223: checking for $with_gmp/gmp.h" >&5
+echo "configure:3225: 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
-#line 3228 "configure"
+#line 3230 "configure"
 #include "confdefs.h"
 #include <$with_gmp/gmp.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3233: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3235: \"$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*
@@ -3268,17 +3270,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:3272: checking for /usr/include/gmp.h" >&5
+echo "configure:3274: 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
-#line 3277 "configure"
+#line 3279 "configure"
 #include "confdefs.h"
 #include </usr/include/gmp.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3282: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3284: \"$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*
@@ -3356,17 +3358,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:3360: checking for $with_cweb/cweb.h" >&5
+echo "configure:3362: 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
-#line 3365 "configure"
+#line 3367 "configure"
 #include "confdefs.h"
 #include <$with_cweb/cweb.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3370: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3372: \"$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*
@@ -3405,17 +3407,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:3409: checking for /usr/include/cweb.h" >&5
+echo "configure:3411: 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
-#line 3414 "configure"
+#line 3416 "configure"
 #include "confdefs.h"
 #include </usr/include/cweb.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3419: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3421: \"$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*
@@ -3486,9 +3488,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:3490: checking for libwrap" >&5
+echo "configure:3492: checking for libwrap" >&5
        cat > conftest.$ac_ext <<EOF
-#line 3492 "configure"
+#line 3494 "configure"
 #include "confdefs.h"
  #include <tcpd.h>
             int deny_severity = 0;
@@ -3498,7 +3500,7 @@ int main() {
  hosts_access(req); 
 ; return 0; }
 EOF
-if { (eval echo configure:3502: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3504: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   
            echo "$ac_t""yes" 1>&6
@@ -3757,13 +3759,11 @@ fi
 
 
 
-
 # ------------------------------------------------
 # Bacula check for various SQL database engines
 # ------------------------------------------------
 
 have_db=no
-db_name=none
 echo $ac_n "checking for MySQL support""... $ac_c" 1>&6
 echo "configure:3769: checking for MySQL support" >&5
 # Check whether --with-mysql or --without-mysql was given.
@@ -3822,6 +3822,7 @@ EOF
     have_db=yes
     support_mysql=yes
     db_name=MySQL
+    DB_NAME=mysql
 
   else
         echo "$ac_t""no" 1>&6
@@ -3845,7 +3846,6 @@ fi
 # ------------------------------------------------
 
 have_db=no
-db_name=none
 echo $ac_n "checking for SQLite support""... $ac_c" 1>&6
 echo "configure:3851: checking for SQLite support" >&5
 # Check whether --with-sqlite or --without-sqlite was given.
@@ -3888,6 +3888,7 @@ EOF
     have_db=yes
     support_sqlite=yes
     db_name=SQLite
+    DB_NAME=sqlite
 
   else
         echo "$ac_t""no" 1>&6
@@ -3906,6 +3907,8 @@ fi
 
 
 
+
+
 cat >> confdefs.h <<\EOF
 #define PROTOTYPES 1
 EOF
@@ -3920,19 +3923,19 @@ fi
 
 
 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:3924: checking for mingw32 environment" >&5
+echo "configure:3927: 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 <<EOF
-#line 3929 "configure"
+#line 3932 "configure"
 #include "confdefs.h"
 
 int main() {
 return __MINGW32__;
 ; return 0; }
 EOF
-if { (eval echo configure:3936: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3939: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_mingw32=yes
 else
@@ -3951,7 +3954,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:3955: checking for executable suffix" >&5
+echo "configure:3958: checking for executable suffix" >&5
 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3961,7 +3964,7 @@ else
   rm -f conftest*
   echo 'int main () { return 0; }' > conftest.$ac_ext
   ac_cv_exeext=
-  if { (eval echo configure:3965: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+  if { (eval echo configure:3968: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
     for file in conftest.*; do
       case $file in
       *.c | *.o | *.obj) ;;
@@ -3989,7 +3992,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:3993: checking for X" >&5
+echo "configure:3996: checking for X" >&5
 
 # Check whether --with-x or --without-x was given.
 if test "${with_x+set}" = set; then
@@ -4051,12 +4054,12 @@ if test "$ac_x_includes" = NO; then
 
   # First, try using that file with no special directory specified.
 cat > conftest.$ac_ext <<EOF
-#line 4055 "configure"
+#line 4058 "configure"
 #include "confdefs.h"
 #include <$x_direct_test_include>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4060: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4063: \"$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*
@@ -4125,14 +4128,14 @@ if test "$ac_x_libraries" = NO; then
   ac_save_LIBS="$LIBS"
   LIBS="-l$x_direct_test_library $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4129 "configure"
+#line 4132 "configure"
 #include "confdefs.h"
 
 int main() {
 ${x_direct_test_function}()
 ; return 0; }
 EOF
-if { (eval echo configure:4136: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4139: \"$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.
@@ -4238,17 +4241,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:4242: checking whether -R must be followed by a space" >&5
+echo "configure:4245: checking whether -R must be followed by a space" >&5
       ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
       cat > conftest.$ac_ext <<EOF
-#line 4245 "configure"
+#line 4248 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4252: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_R_nospace=yes
 else
@@ -4264,14 +4267,14 @@ rm -f conftest*
       else
        LIBS="$ac_xsave_LIBS -R $x_libraries"
        cat > conftest.$ac_ext <<EOF
-#line 4268 "configure"
+#line 4271 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4275: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_R_space=yes
 else
@@ -4303,7 +4306,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:4307: checking for dnet_ntoa in -ldnet" >&5
+echo "configure:4310: 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
@@ -4311,7 +4314,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldnet  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4315 "configure"
+#line 4318 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4322,7 +4325,7 @@ int main() {
 dnet_ntoa()
 ; return 0; }
 EOF
-if { (eval echo configure:4326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4329: \"$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
@@ -4344,7 +4347,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:4348: checking for dnet_ntoa in -ldnet_stub" >&5
+echo "configure:4351: 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
@@ -4352,7 +4355,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldnet_stub  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4356 "configure"
+#line 4359 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4363,7 +4366,7 @@ int main() {
 dnet_ntoa()
 ; return 0; }
 EOF
-if { (eval echo configure:4367: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4370: \"$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
@@ -4392,12 +4395,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:4396: checking for gethostbyname" >&5
+echo "configure:4399: 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 <<EOF
-#line 4401 "configure"
+#line 4404 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gethostbyname(); below.  */
@@ -4420,7 +4423,7 @@ gethostbyname();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4424: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4427: \"$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
@@ -4441,7 +4444,7 @@ fi
 
     if test $ac_cv_func_gethostbyname = no; then
       echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:4445: checking for gethostbyname in -lnsl" >&5
+echo "configure:4448: 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
@@ -4449,7 +4452,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4453 "configure"
+#line 4456 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4460,7 +4463,7 @@ int main() {
 gethostbyname()
 ; return 0; }
 EOF
-if { (eval echo configure:4464: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4467: \"$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
@@ -4490,12 +4493,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:4494: checking for connect" >&5
+echo "configure:4497: 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 <<EOF
-#line 4499 "configure"
+#line 4502 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char connect(); below.  */
@@ -4518,7 +4521,7 @@ connect();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4522: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4525: \"$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
@@ -4539,7 +4542,7 @@ fi
 
     if test $ac_cv_func_connect = no; then
       echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
-echo "configure:4543: checking for connect in -lsocket" >&5
+echo "configure:4546: 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
@@ -4547,7 +4550,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4551 "configure"
+#line 4554 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4558,7 +4561,7 @@ int main() {
 connect()
 ; return 0; }
 EOF
-if { (eval echo configure:4562: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4565: \"$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
@@ -4582,12 +4585,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:4586: checking for remove" >&5
+echo "configure:4589: 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 <<EOF
-#line 4591 "configure"
+#line 4594 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char remove(); below.  */
@@ -4610,7 +4613,7 @@ remove();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4614: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4617: \"$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
@@ -4631,7 +4634,7 @@ fi
 
     if test $ac_cv_func_remove = no; then
       echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
-echo "configure:4635: checking for remove in -lposix" >&5
+echo "configure:4638: 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
@@ -4639,7 +4642,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lposix  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4643 "configure"
+#line 4646 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4650,7 +4653,7 @@ int main() {
 remove()
 ; return 0; }
 EOF
-if { (eval echo configure:4654: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4657: \"$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
@@ -4674,12 +4677,12 @@ fi
 
     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
     echo $ac_n "checking for shmat""... $ac_c" 1>&6
-echo "configure:4678: checking for shmat" >&5
+echo "configure:4681: 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 <<EOF
-#line 4683 "configure"
+#line 4686 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char shmat(); below.  */
@@ -4702,7 +4705,7 @@ shmat();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4709: \"$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
@@ -4723,7 +4726,7 @@ fi
 
     if test $ac_cv_func_shmat = no; then
       echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
-echo "configure:4727: checking for shmat in -lipc" >&5
+echo "configure:4730: 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
@@ -4731,7 +4734,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lipc  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4735 "configure"
+#line 4738 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4742,7 +4745,7 @@ int main() {
 shmat()
 ; return 0; }
 EOF
-if { (eval echo configure:4746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4749: \"$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
@@ -4775,7 +4778,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:4779: checking for IceConnectionNumber in -lICE" >&5
+echo "configure:4782: 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
@@ -4783,7 +4786,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4787 "configure"
+#line 4790 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4794,7 +4797,7 @@ int main() {
 IceConnectionNumber()
 ; return 0; }
 EOF
-if { (eval echo configure:4798: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4801: \"$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
@@ -4839,17 +4842,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:4843: checking for $ac_hdr" >&5
+echo "configure:4846: 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
-#line 4848 "configure"
+#line 4851 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4853: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4856: \"$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*
@@ -4876,12 +4879,12 @@ fi
 done
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:4880: checking for ANSI C header files" >&5
+echo "configure:4883: 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 <<EOF
-#line 4885 "configure"
+#line 4888 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -4889,7 +4892,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4893: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4896: \"$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*
@@ -4906,7 +4909,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
-#line 4910 "configure"
+#line 4913 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -4924,7 +4927,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
-#line 4928 "configure"
+#line 4931 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -4945,7 +4948,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 4949 "configure"
+#line 4952 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -4956,7 +4959,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:4960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -4980,19 +4983,19 @@ EOF
 fi
 
 echo $ac_n "checking whether sys/types.h defines makedev""... $ac_c" 1>&6
-echo "configure:4984: checking whether sys/types.h defines makedev" >&5
+echo "configure:4987: 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 <<EOF
-#line 4989 "configure"
+#line 4992 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int main() {
 return makedev(0, 0);
 ; return 0; }
 EOF
-if { (eval echo configure:4996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4999: \"$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
@@ -5010,17 +5013,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:5014: checking for sys/mkdev.h" >&5
+echo "configure:5017: 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
-#line 5019 "configure"
+#line 5022 "configure"
 #include "confdefs.h"
 #include <sys/mkdev.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5024: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5027: \"$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*
@@ -5048,17 +5051,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:5052: checking for sys/sysmacros.h" >&5
+echo "configure:5055: 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
-#line 5057 "configure"
+#line 5060 "configure"
 #include "confdefs.h"
 #include <sys/sysmacros.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5062: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5065: \"$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*
@@ -5090,12 +5093,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:5094: checking for $ac_hdr that defines DIR" >&5
+echo "configure:5097: 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 <<EOF
-#line 5099 "configure"
+#line 5102 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_hdr>
@@ -5103,7 +5106,7 @@ int main() {
 DIR *dirp = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:5107: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5110: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_dirent_$ac_safe=yes"
 else
@@ -5128,7 +5131,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:5132: checking for opendir in -ldir" >&5
+echo "configure:5135: 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
@@ -5136,7 +5139,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldir  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5140 "configure"
+#line 5143 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5147,7 +5150,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:5151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5154: \"$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
@@ -5169,7 +5172,7 @@ fi
 
 else
 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:5173: checking for opendir in -lx" >&5
+echo "configure:5176: 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
@@ -5177,7 +5180,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lx  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5181 "configure"
+#line 5184 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5188,7 +5191,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:5192: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5195: \"$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
@@ -5211,12 +5214,12 @@ fi
 fi
 
 echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6
-echo "configure:5215: checking whether stat file-mode macros are broken" >&5
+echo "configure:5218: 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 <<EOF
-#line 5220 "configure"
+#line 5223 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -5267,12 +5270,12 @@ EOF
 fi
 
 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:5271: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:5274: 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 <<EOF
-#line 5276 "configure"
+#line 5279 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -5288,7 +5291,7 @@ wait (&s);
 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
 ; return 0; }
 EOF
-if { (eval echo configure:5292: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5295: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_sys_wait_h=yes
 else
@@ -5309,12 +5312,12 @@ EOF
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:5313: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:5316: 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 <<EOF
-#line 5318 "configure"
+#line 5321 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -5323,7 +5326,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:5327: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5330: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -5344,12 +5347,12 @@ EOF
 fi
 
 echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
-echo "configure:5348: checking for st_blksize in struct stat" >&5
+echo "configure:5351: 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 <<EOF
-#line 5353 "configure"
+#line 5356 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -5357,7 +5360,7 @@ int main() {
 struct stat s; s.st_blksize;
 ; return 0; }
 EOF
-if { (eval echo configure:5361: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5364: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_st_blksize=yes
 else
@@ -5378,12 +5381,12 @@ EOF
 fi
 
 echo $ac_n "checking for st_blocks in struct stat""... $ac_c" 1>&6
-echo "configure:5382: checking for st_blocks in struct stat" >&5
+echo "configure:5385: 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 <<EOF
-#line 5387 "configure"
+#line 5390 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -5391,7 +5394,7 @@ int main() {
 struct stat s; s.st_blocks;
 ; return 0; }
 EOF
-if { (eval echo configure:5395: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5398: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_st_blocks=yes
 else
@@ -5414,12 +5417,12 @@ else
 fi
 
 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:5418: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:5421: 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 <<EOF
-#line 5423 "configure"
+#line 5426 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <time.h>
@@ -5427,7 +5430,7 @@ int main() {
 struct tm *tp; tp->tm_sec;
 ; return 0; }
 EOF
-if { (eval echo configure:5431: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5434: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm=time.h
 else
@@ -5448,12 +5451,12 @@ EOF
 fi
 
 echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
-echo "configure:5452: checking for tm_zone in struct tm" >&5
+echo "configure:5455: 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 <<EOF
-#line 5457 "configure"
+#line 5460 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_cv_struct_tm>
@@ -5461,7 +5464,7 @@ int main() {
 struct tm tm; tm.tm_zone;
 ; return 0; }
 EOF
-if { (eval echo configure:5465: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5468: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm_zone=yes
 else
@@ -5481,12 +5484,12 @@ EOF
 
 else
   echo $ac_n "checking for tzname""... $ac_c" 1>&6
-echo "configure:5485: checking for tzname" >&5
+echo "configure:5488: 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 <<EOF
-#line 5490 "configure"
+#line 5493 "configure"
 #include "confdefs.h"
 #include <time.h>
 #ifndef tzname /* For SGI.  */
@@ -5496,7 +5499,7 @@ int main() {
 atoi(*tzname);
 ; return 0; }
 EOF
-if { (eval echo configure:5500: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5503: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_var_tzname=yes
 else
@@ -5523,12 +5526,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:5527: checking for utime.h" >&5
+echo "configure:5530: 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 <<EOF
-#line 5532 "configure"
+#line 5535 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -5537,7 +5540,7 @@ int main() {
 struct utimbuf foo
 ; return 0; }
 EOF
-if { (eval echo configure:5541: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5544: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   tar_cv_header_utime_h=yes
 else
@@ -5556,12 +5559,12 @@ EOF
 
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:5560: checking for working const" >&5
+echo "configure:5563: 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 <<EOF
-#line 5565 "configure"
+#line 5568 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -5610,7 +5613,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:5614: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5617: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -5633,17 +5636,17 @@ fi
 
 
 echo $ac_n "checking how to get filesystem type""... $ac_c" 1>&6
-echo "configure:5637: checking how to get filesystem type" >&5
+echo "configure:5640: checking how to get filesystem type" >&5
 fstype=no
 # The order of these tests is important.
 cat > conftest.$ac_ext <<EOF
-#line 5641 "configure"
+#line 5644 "configure"
 #include "confdefs.h"
 #include <sys/statvfs.h>
 #include <sys/fstyp.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5647: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5650: \"$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*
@@ -5659,13 +5662,13 @@ fi
 rm -f conftest*
 if test $fstype = no; then
 cat > conftest.$ac_ext <<EOF
-#line 5663 "configure"
+#line 5666 "configure"
 #include "confdefs.h"
 #include <sys/statfs.h>
 #include <sys/fstyp.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5669: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5672: \"$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*
@@ -5682,13 +5685,13 @@ rm -f conftest*
 fi
 if test $fstype = no; then
 cat > conftest.$ac_ext <<EOF
-#line 5686 "configure"
+#line 5689 "configure"
 #include "confdefs.h"
 #include <sys/statfs.h>
 #include <sys/vmount.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5692: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5695: \"$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*
@@ -5705,12 +5708,12 @@ rm -f conftest*
 fi
 if test $fstype = no; then  
 cat > conftest.$ac_ext <<EOF
-#line 5709 "configure"
+#line 5712 "configure"
 #include "confdefs.h"
 #include <mntent.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5714: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5717: \"$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*
@@ -5727,7 +5730,7 @@ rm -f conftest*
 fi
 if test $fstype = no; then  
 cat > conftest.$ac_ext <<EOF
-#line 5731 "configure"
+#line 5734 "configure"
 #include "confdefs.h"
 #include <sys/mount.h>
 EOF
@@ -5744,13 +5747,13 @@ rm -f conftest*
 fi
 if test $fstype = no; then  
 cat > conftest.$ac_ext <<EOF
-#line 5748 "configure"
+#line 5751 "configure"
 #include "confdefs.h"
 #include <sys/mount.h>
 #include <sys/fs_types.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5754: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5757: \"$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*
@@ -5768,12 +5771,12 @@ fi
 echo "$ac_t""$fstype" 1>&6
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:5772: checking return type of signal handlers" >&5
+echo "configure:5775: 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 <<EOF
-#line 5777 "configure"
+#line 5780 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -5790,7 +5793,7 @@ int main() {
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:5794: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5797: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -5810,13 +5813,13 @@ EOF
 
 
 echo $ac_n "checking for type of signal functions""... $ac_c" 1>&6
-echo "configure:5814: checking for type of signal functions" >&5
+echo "configure:5817: 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 <<EOF
-#line 5820 "configure"
+#line 5823 "configure"
 #include "confdefs.h"
 #include <signal.h>
 int main() {
@@ -5829,7 +5832,7 @@ int main() {
   
 ; return 0; }
 EOF
-if { (eval echo configure:5833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5836: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   bash_cv_signal_vintage=posix
 else
@@ -5838,7 +5841,7 @@ else
   rm -rf conftest*
   
     cat > conftest.$ac_ext <<EOF
-#line 5842 "configure"
+#line 5845 "configure"
 #include "confdefs.h"
 #include <signal.h>
 int main() {
@@ -5848,7 +5851,7 @@ int main() {
     
 ; return 0; }
 EOF
-if { (eval echo configure:5852: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5855: \"$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
@@ -5857,7 +5860,7 @@ else
   rm -rf conftest*
   
       cat > conftest.$ac_ext <<EOF
-#line 5861 "configure"
+#line 5864 "configure"
 #include "confdefs.h"
 
         #include <signal.h>
@@ -5870,7 +5873,7 @@ int main() {
         
 ; return 0; }
 EOF
-if { (eval echo configure:5874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5877: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   bash_cv_signal_vintage=svr3
 else
@@ -5909,12 +5912,12 @@ EOF
 fi
 
 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:5913: checking for mode_t" >&5
+echo "configure:5916: 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 <<EOF
-#line 5918 "configure"
+#line 5921 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -5942,12 +5945,12 @@ EOF
 fi
 
 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:5946: checking for uid_t in sys/types.h" >&5
+echo "configure:5949: 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
-#line 5951 "configure"
+#line 5954 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 EOF
@@ -5976,12 +5979,12 @@ EOF
 fi
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:5980: checking for size_t" >&5
+echo "configure:5983: 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 <<EOF
-#line 5985 "configure"
+#line 5988 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -6009,12 +6012,12 @@ EOF
 fi
 
 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:6013: checking for pid_t" >&5
+echo "configure:6016: 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 <<EOF
-#line 6018 "configure"
+#line 6021 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -6042,12 +6045,12 @@ EOF
 fi
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:6046: checking for off_t" >&5
+echo "configure:6049: 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 <<EOF
-#line 6051 "configure"
+#line 6054 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -6075,12 +6078,12 @@ EOF
 fi
 
 echo $ac_n "checking for ino_t""... $ac_c" 1>&6
-echo "configure:6079: checking for ino_t" >&5
+echo "configure:6082: 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 <<EOF
-#line 6084 "configure"
+#line 6087 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -6108,12 +6111,12 @@ EOF
 fi
 
 echo $ac_n "checking for dev_t""... $ac_c" 1>&6
-echo "configure:6112: checking for dev_t" >&5
+echo "configure:6115: 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 <<EOF
-#line 6117 "configure"
+#line 6120 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -6141,12 +6144,12 @@ EOF
 fi
 
 echo $ac_n "checking for daddr_t""... $ac_c" 1>&6
-echo "configure:6145: checking for daddr_t" >&5
+echo "configure:6148: 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 <<EOF
-#line 6150 "configure"
+#line 6153 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -6174,12 +6177,12 @@ EOF
 fi
 
 echo $ac_n "checking for major_t""... $ac_c" 1>&6
-echo "configure:6178: checking for major_t" >&5
+echo "configure:6181: 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 <<EOF
-#line 6183 "configure"
+#line 6186 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -6207,12 +6210,12 @@ EOF
 fi
 
 echo $ac_n "checking for minor_t""... $ac_c" 1>&6
-echo "configure:6211: checking for minor_t" >&5
+echo "configure:6214: 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 <<EOF
-#line 6216 "configure"
+#line 6219 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -6240,12 +6243,12 @@ EOF
 fi
 
 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
-echo "configure:6244: checking for ssize_t" >&5
+echo "configure:6247: 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 <<EOF
-#line 6249 "configure"
+#line 6252 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -6273,12 +6276,12 @@ EOF
 fi
 
 echo $ac_n "checking for st_blocks in struct stat""... $ac_c" 1>&6
-echo "configure:6277: checking for st_blocks in struct stat" >&5
+echo "configure:6280: 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 <<EOF
-#line 6282 "configure"
+#line 6285 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -6286,7 +6289,7 @@ int main() {
 struct stat s; s.st_blocks;
 ; return 0; }
 EOF
-if { (eval echo configure:6290: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6293: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_st_blocks=yes
 else
@@ -6309,12 +6312,12 @@ else
 fi
 
 echo $ac_n "checking for st_rdev in struct stat""... $ac_c" 1>&6
-echo "configure:6313: checking for st_rdev in struct stat" >&5
+echo "configure:6316: 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 <<EOF
-#line 6318 "configure"
+#line 6321 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -6322,7 +6325,7 @@ int main() {
 struct stat s; s.st_rdev;
 ; return 0; }
 EOF
-if { (eval echo configure:6326: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6329: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_st_rdev=yes
 else
@@ -6343,12 +6346,12 @@ EOF
 fi
 
 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:6347: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:6350: 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 <<EOF
-#line 6352 "configure"
+#line 6355 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <time.h>
@@ -6356,7 +6359,7 @@ int main() {
 struct tm *tp; tp->tm_sec;
 ; return 0; }
 EOF
-if { (eval echo configure:6360: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6363: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm=time.h
 else
@@ -6377,12 +6380,12 @@ EOF
 fi
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:6381: checking for working const" >&5
+echo "configure:6384: 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 <<EOF
-#line 6386 "configure"
+#line 6389 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -6431,7 +6434,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:6435: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6438: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -6454,7 +6457,7 @@ fi
 
 
 echo $ac_n "checking size of char""... $ac_c" 1>&6
-echo "configure:6458: checking size of char" >&5
+echo "configure:6461: 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
@@ -6462,7 +6465,7 @@ else
   ac_cv_sizeof_char=1
 else
   cat > conftest.$ac_ext <<EOF
-#line 6466 "configure"
+#line 6469 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int main()
@@ -6473,7 +6476,7 @@ int main()
   return(0);
 }
 EOF
-if { (eval echo configure:6477: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6480: \"$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
@@ -6493,7 +6496,7 @@ EOF
 
 
 echo $ac_n "checking size of short int""... $ac_c" 1>&6
-echo "configure:6497: checking size of short int" >&5
+echo "configure:6500: 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
@@ -6501,7 +6504,7 @@ else
   ac_cv_sizeof_short_int=2
 else
   cat > conftest.$ac_ext <<EOF
-#line 6505 "configure"
+#line 6508 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int main()
@@ -6512,7 +6515,7 @@ int main()
   return(0);
 }
 EOF
-if { (eval echo configure:6516: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6519: \"$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
@@ -6532,7 +6535,7 @@ EOF
 
 
 echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:6536: checking size of int" >&5
+echo "configure:6539: 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
@@ -6540,7 +6543,7 @@ else
   ac_cv_sizeof_int=4
 else
   cat > conftest.$ac_ext <<EOF
-#line 6544 "configure"
+#line 6547 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int main()
@@ -6551,7 +6554,7 @@ int main()
   return(0);
 }
 EOF
-if { (eval echo configure:6555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6558: \"$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
@@ -6571,7 +6574,7 @@ EOF
 
 
 echo $ac_n "checking size of long int""... $ac_c" 1>&6
-echo "configure:6575: checking size of long int" >&5
+echo "configure:6578: 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
@@ -6579,7 +6582,7 @@ else
   ac_cv_sizeof_long_int=4
 else
   cat > conftest.$ac_ext <<EOF
-#line 6583 "configure"
+#line 6586 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int main()
@@ -6590,7 +6593,7 @@ int main()
   return(0);
 }
 EOF
-if { (eval echo configure:6594: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6597: \"$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
@@ -6610,7 +6613,7 @@ EOF
 
 
 echo $ac_n "checking size of long long int""... $ac_c" 1>&6
-echo "configure:6614: checking size of long long int" >&5
+echo "configure:6617: 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
@@ -6618,7 +6621,7 @@ else
   ac_cv_sizeof_long_long_int=8
 else
   cat > conftest.$ac_ext <<EOF
-#line 6622 "configure"
+#line 6625 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int main()
@@ -6629,7 +6632,7 @@ int main()
   return(0);
 }
 EOF
-if { (eval echo configure:6633: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6636: \"$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
@@ -6649,7 +6652,7 @@ EOF
 
 
 echo $ac_n "checking size of int *""... $ac_c" 1>&6
-echo "configure:6653: checking size of int *" >&5
+echo "configure:6656: 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
@@ -6657,7 +6660,7 @@ else
   ac_cv_sizeof_int_p=4
 else
   cat > conftest.$ac_ext <<EOF
-#line 6661 "configure"
+#line 6664 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int main()
@@ -6668,7 +6671,7 @@ int main()
   return(0);
 }
 EOF
-if { (eval echo configure:6672: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6675: \"$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
@@ -6690,20 +6693,20 @@ EOF
 
 # Check for sys/types.h types
 echo $ac_n "checking for u_int type""... $ac_c" 1>&6
-echo "configure:6694: checking for u_int type" >&5
+echo "configure:6697: 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 <<EOF
-#line 6700 "configure"
+#line 6703 "configure"
 #include "confdefs.h"
  #include <sys/types.h> 
 int main() {
  u_int a; a = 1;
 ; return 0; }
 EOF
-if { (eval echo configure:6707: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6710: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
    ac_cv_have_u_int="yes" 
 else
@@ -6727,20 +6730,20 @@ EOF
 fi
 
 echo $ac_n "checking for intmax_t type""... $ac_c" 1>&6
-echo "configure:6731: checking for intmax_t type" >&5
+echo "configure:6734: 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 <<EOF
-#line 6737 "configure"
+#line 6740 "configure"
 #include "confdefs.h"
  #include <sys/types.h> 
 int main() {
  intmax_t a; a = 1;
 ; return 0; }
 EOF
-if { (eval echo configure:6744: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6747: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
    ac_cv_have_intmax_t="yes" 
 else
@@ -6749,14 +6752,14 @@ else
   rm -rf conftest*
    
         cat > conftest.$ac_ext <<EOF
-#line 6753 "configure"
+#line 6756 "configure"
 #include "confdefs.h"
  #include <stdint.h> 
 int main() {
  intmax_t a; a = 1;
 ; return 0; }
 EOF
-if { (eval echo configure:6760: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6763: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
    ac_cv_have_intmax_t="yes" 
 else
@@ -6786,20 +6789,20 @@ fi
 
 
 echo $ac_n "checking for u_intmax_t type""... $ac_c" 1>&6
-echo "configure:6790: checking for u_intmax_t type" >&5
+echo "configure:6793: 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 <<EOF
-#line 6796 "configure"
+#line 6799 "configure"
 #include "confdefs.h"
  #include <sys/types.h> 
 int main() {
  u_intmax_t a; a = 1;
 ; return 0; }
 EOF
-if { (eval echo configure:6803: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6806: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
    ac_cv_have_u_intmax_t="yes" 
 else
@@ -6808,14 +6811,14 @@ else
   rm -rf conftest*
    
         cat > conftest.$ac_ext <<EOF
-#line 6812 "configure"
+#line 6815 "configure"
 #include "confdefs.h"
  #include <stdint.h> 
 int main() {
  u_intmax_t a; a = 1;
 ; return 0; }
 EOF
-if { (eval echo configure:6819: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6822: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
    ac_cv_have_u_intmax_t="yes" 
 else
@@ -6844,20 +6847,20 @@ fi
 
 
 echo $ac_n "checking for intXX_t types""... $ac_c" 1>&6
-echo "configure:6848: checking for intXX_t types" >&5
+echo "configure:6851: 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 <<EOF
-#line 6854 "configure"
+#line 6857 "configure"
 #include "confdefs.h"
  #include <sys/types.h> 
 int main() {
  int8_t a; int16_t b; int32_t c; a = b = c = 1;
 ; return 0; }
 EOF
-if { (eval echo configure:6861: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6864: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
    ac_cv_have_intxx_t="yes" 
 else
@@ -6881,20 +6884,20 @@ EOF
 fi
        
 echo $ac_n "checking for int64_t type""... $ac_c" 1>&6
-echo "configure:6885: checking for int64_t type" >&5
+echo "configure:6888: 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 <<EOF
-#line 6891 "configure"
+#line 6894 "configure"
 #include "confdefs.h"
  #include <sys/types.h> 
 int main() {
  int64_t a; a = 1;
 ; return 0; }
 EOF
-if { (eval echo configure:6898: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6901: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
    ac_cv_have_int64_t="yes" 
 else
@@ -6918,20 +6921,20 @@ EOF
 fi
        
 echo $ac_n "checking for u_intXX_t types""... $ac_c" 1>&6
-echo "configure:6922: checking for u_intXX_t types" >&5
+echo "configure:6925: 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 <<EOF
-#line 6928 "configure"
+#line 6931 "configure"
 #include "confdefs.h"
  #include <sys/types.h> 
 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:6935: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6938: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
    ac_cv_have_u_intxx_t="yes" 
 else
@@ -6955,20 +6958,20 @@ EOF
 fi
 
 echo $ac_n "checking for u_int64_t types""... $ac_c" 1>&6
-echo "configure:6959: checking for u_int64_t types" >&5
+echo "configure:6962: 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 <<EOF
-#line 6965 "configure"
+#line 6968 "configure"
 #include "confdefs.h"
  #include <sys/types.h> 
 int main() {
  u_int64_t a; a = 1;
 ; return 0; }
 EOF
-if { (eval echo configure:6972: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6975: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
    ac_cv_have_u_int64_t="yes" 
 else
@@ -6995,9 +6998,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:6999: checking for intXX_t and u_intXX_t types in sys/bitypes.h" >&5
+echo "configure:7002: checking for intXX_t and u_intXX_t types in sys/bitypes.h" >&5
    cat > conftest.$ac_ext <<EOF
-#line 7001 "configure"
+#line 7004 "configure"
 #include "confdefs.h"
  #include <sys/bitypes.h>  
 int main() {
@@ -7006,7 +7009,7 @@ int main() {
        a = b = c = e = f = g = 1;  
 ; return 0; }
 EOF
-if { (eval echo configure:7010: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7013: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
    cat >> confdefs.h <<\EOF
 #define HAVE_U_INTXX_T 1
@@ -7033,13 +7036,13 @@ fi
 
 if test -z "$have_u_intxx_t" ; then
    echo $ac_n "checking for uintXX_t types""... $ac_c" 1>&6
-echo "configure:7037: checking for uintXX_t types" >&5
+echo "configure:7040: 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 <<EOF
-#line 7043 "configure"
+#line 7046 "configure"
 #include "confdefs.h"
  #include <sys/types.h> 
 int main() {
@@ -7047,7 +7050,7 @@ int main() {
           uint32_t c; a = b = c = 1; 
 ; return 0; }
 EOF
-if { (eval echo configure:7051: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7054: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
    ac_cv_have_uintxx_t="yes" 
 else
@@ -7087,12 +7090,12 @@ for ac_func in \
        
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7091: checking for $ac_func" >&5
+echo "configure:7094: 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 <<EOF
-#line 7096 "configure"
+#line 7099 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7115,7 +7118,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7119: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7122: \"$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
@@ -7145,12 +7148,12 @@ done
 for ac_func in fchdir
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7149: checking for $ac_func" >&5
+echo "configure:7152: 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 <<EOF
-#line 7154 "configure"
+#line 7157 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7173,7 +7176,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7177: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7180: \"$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
@@ -7204,12 +7207,12 @@ done
 for ac_func in snprintf vsnprintf
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7208: checking for $ac_func" >&5
+echo "configure:7211: 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 <<EOF
-#line 7213 "configure"
+#line 7216 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7232,7 +7235,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7236: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7239: \"$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
@@ -7260,12 +7263,12 @@ done
 for ac_func in localtime_r
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7264: checking for $ac_func" >&5
+echo "configure:7267: 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 <<EOF
-#line 7269 "configure"
+#line 7272 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7288,7 +7291,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7295: \"$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
@@ -7319,12 +7322,12 @@ done
 for ac_func in readdir_r
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7323: checking for $ac_func" >&5
+echo "configure:7326: 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 <<EOF
-#line 7328 "configure"
+#line 7331 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7347,7 +7350,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7351: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7354: \"$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
@@ -7377,12 +7380,12 @@ done
 
 # Find where sockets are (especially for Solaris)
 echo $ac_n "checking for socket""... $ac_c" 1>&6
-echo "configure:7381: checking for socket" >&5
+echo "configure:7384: 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 <<EOF
-#line 7386 "configure"
+#line 7389 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char socket(); below.  */
@@ -7405,7 +7408,7 @@ socket();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7409: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7412: \"$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
@@ -7423,7 +7426,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:7427: checking for socket in -lxnet" >&5
+echo "configure:7430: 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
@@ -7431,7 +7434,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lxnet  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7435 "configure"
+#line 7438 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7442,7 +7445,7 @@ int main() {
 socket()
 ; return 0; }
 EOF
-if { (eval echo configure:7446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7449: \"$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
@@ -7470,7 +7473,7 @@ else
 fi
 
     echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
-echo "configure:7474: checking for socket in -lsocket" >&5
+echo "configure:7477: 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
@@ -7478,7 +7481,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7482 "configure"
+#line 7485 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7489,7 +7492,7 @@ int main() {
 socket()
 ; return 0; }
 EOF
-if { (eval echo configure:7493: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7496: \"$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
@@ -7517,7 +7520,7 @@ else
 fi
 
     echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
-echo "configure:7521: checking for socket in -linet" >&5
+echo "configure:7524: 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
@@ -7525,7 +7528,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-linet  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7529 "configure"
+#line 7532 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7536,7 +7539,7 @@ int main() {
 socket()
 ; return 0; }
 EOF
-if { (eval echo configure:7540: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7543: \"$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
@@ -7568,12 +7571,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:7572: checking for gethostbyname" >&5
+echo "configure:7575: 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 <<EOF
-#line 7577 "configure"
+#line 7580 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gethostbyname(); below.  */
@@ -7596,7 +7599,7 @@ gethostbyname();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7600: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7603: \"$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
@@ -7614,7 +7617,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:7618: checking for gethostbyname in -lnsl" >&5
+echo "configure:7621: 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
@@ -7622,7 +7625,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7626 "configure"
+#line 7629 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7633,7 +7636,7 @@ int main() {
 gethostbyname()
 ; return 0; }
 EOF
-if { (eval echo configure:7637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7640: \"$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
@@ -7661,7 +7664,7 @@ else
 fi
 
     echo $ac_n "checking for gethostbyname in -lresolv""... $ac_c" 1>&6
-echo "configure:7665: checking for gethostbyname in -lresolv" >&5
+echo "configure:7668: 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
@@ -7669,7 +7672,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lresolv  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7673 "configure"
+#line 7676 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7680,7 +7683,7 @@ int main() {
 gethostbyname()
 ; return 0; }
 EOF
-if { (eval echo configure:7684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7687: \"$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
@@ -7712,12 +7715,12 @@ fi
 
 
 echo $ac_n "checking for strftime""... $ac_c" 1>&6
-echo "configure:7716: checking for strftime" >&5
+echo "configure:7719: 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 <<EOF
-#line 7721 "configure"
+#line 7724 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char strftime(); below.  */
@@ -7740,7 +7743,7 @@ strftime();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7747: \"$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
@@ -7762,7 +7765,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:7766: checking for strftime in -lintl" >&5
+echo "configure:7769: 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
@@ -7770,7 +7773,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lintl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7774 "configure"
+#line 7777 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7781,7 +7784,7 @@ int main() {
 strftime()
 ; return 0; }
 EOF
-if { (eval echo configure:7785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7788: \"$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
@@ -7808,12 +7811,12 @@ fi
 fi
 
 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
-echo "configure:7812: checking for vprintf" >&5
+echo "configure:7815: 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 <<EOF
-#line 7817 "configure"
+#line 7820 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char vprintf(); below.  */
@@ -7836,7 +7839,7 @@ vprintf();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7840: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7843: \"$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
@@ -7860,12 +7863,12 @@ fi
 
 if test "$ac_cv_func_vprintf" != yes; then
 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
-echo "configure:7864: checking for _doprnt" >&5
+echo "configure:7867: 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 <<EOF
-#line 7869 "configure"
+#line 7872 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char _doprnt(); below.  */
@@ -7888,7 +7891,7 @@ _doprnt();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7895: \"$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
@@ -7915,19 +7918,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:7919: checking for working alloca.h" >&5
+echo "configure:7922: 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 <<EOF
-#line 7924 "configure"
+#line 7927 "configure"
 #include "confdefs.h"
 #include <alloca.h>
 int main() {
 char *p = alloca(2 * sizeof(int));
 ; return 0; }
 EOF
-if { (eval echo configure:7931: \"$ac_link\") 1>&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_header_alloca_h=yes
 else
@@ -7948,12 +7951,12 @@ EOF
 fi
 
 echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:7952: checking for alloca" >&5
+echo "configure:7955: 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 <<EOF
-#line 7957 "configure"
+#line 7960 "configure"
 #include "confdefs.h"
 
 #ifdef __GNUC__
@@ -7981,7 +7984,7 @@ int main() {
 char *p = (char *) alloca(1);
 ; return 0; }
 EOF
-if { (eval echo configure:7985: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7988: \"$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
@@ -8013,12 +8016,12 @@ EOF
 
 
 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:8017: checking whether alloca needs Cray hooks" >&5
+echo "configure:8020: 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 <<EOF
-#line 8022 "configure"
+#line 8025 "configure"
 #include "confdefs.h"
 #if defined(CRAY) && ! defined(CRAY2)
 webecray
@@ -8043,12 +8046,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&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:8047: checking for $ac_func" >&5
+echo "configure:8050: 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 <<EOF
-#line 8052 "configure"
+#line 8055 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -8071,7 +8074,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:8075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8078: \"$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
@@ -8098,7 +8101,7 @@ done
 fi
 
 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:8102: checking stack direction for C alloca" >&5
+echo "configure:8105: 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
@@ -8106,7 +8109,7 @@ else
   ac_cv_c_stack_direction=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 8110 "configure"
+#line 8113 "configure"
 #include "confdefs.h"
 find_stack_direction ()
 {
@@ -8125,7 +8128,7 @@ main ()
   exit (find_stack_direction() < 0);
 }
 EOF
-if { (eval echo configure:8129: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8132: \"$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
@@ -8148,7 +8151,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:8152: checking for getmntent in -lsun" >&5
+echo "configure:8155: 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
@@ -8156,7 +8159,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsun  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8160 "configure"
+#line 8163 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8167,7 +8170,7 @@ int main() {
 getmntent()
 ; return 0; }
 EOF
-if { (eval echo configure:8171: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8174: \"$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
@@ -8186,7 +8189,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:8190: checking for getmntent in -lseq" >&5
+echo "configure:8193: 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
@@ -8194,7 +8197,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lseq  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8198 "configure"
+#line 8201 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8205,7 +8208,7 @@ int main() {
 getmntent()
 ; return 0; }
 EOF
-if { (eval echo configure:8209: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8212: \"$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
@@ -8224,7 +8227,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:8228: checking for getmntent in -lgen" >&5
+echo "configure:8231: 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
@@ -8232,7 +8235,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgen  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8236 "configure"
+#line 8239 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8243,7 +8246,7 @@ int main() {
 getmntent()
 ; return 0; }
 EOF
-if { (eval echo configure:8247: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8250: \"$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
@@ -8268,12 +8271,12 @@ fi
 fi
 
 echo $ac_n "checking for getmntent""... $ac_c" 1>&6
-echo "configure:8272: checking for getmntent" >&5
+echo "configure:8275: 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 <<EOF
-#line 8277 "configure"
+#line 8280 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char getmntent(); below.  */
@@ -8296,7 +8299,7 @@ getmntent();
 
 ; return 0; }
 EOF
-if { (eval echo configure:8300: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8303: \"$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
@@ -8319,7 +8322,7 @@ else
 fi
 
 echo $ac_n "checking whether closedir returns void""... $ac_c" 1>&6
-echo "configure:8323: checking whether closedir returns void" >&5
+echo "configure:8326: 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
@@ -8327,13 +8330,13 @@ else
   ac_cv_func_closedir_void=yes
 else
   cat > conftest.$ac_ext <<EOF
-#line 8331 "configure"
+#line 8334 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_header_dirent>
 int closedir(); main() { exit(closedir(opendir(".")) != 0); }
 EOF
-if { (eval echo configure:8337: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8340: \"$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
@@ -8356,7 +8359,7 @@ EOF
 fi
 
 echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6
-echo "configure:8360: checking whether setpgrp takes no argument" >&5
+echo "configure:8363: 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
@@ -8364,7 +8367,7 @@ else
   { echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 8368 "configure"
+#line 8371 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_UNISTD_H
@@ -8384,7 +8387,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:8388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8391: \"$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
@@ -8407,7 +8410,7 @@ EOF
 
 fi
                      echo $ac_n "checking for working fnmatch""... $ac_c" 1>&6
-echo "configure:8411: checking for working fnmatch" >&5
+echo "configure:8414: 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
@@ -8418,11 +8421,11 @@ if test "$cross_compiling" = yes; then
   ac_cv_func_fnmatch_works=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 8422 "configure"
+#line 8425 "configure"
 #include "confdefs.h"
 main() { exit (fnmatch ("a*", "abc", 0) != 0); }
 EOF
-if { (eval echo configure:8426: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8429: \"$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
@@ -8447,7 +8450,7 @@ fi
 
 
 echo $ac_n "checking for setlocale in -lxpg4""... $ac_c" 1>&6
-echo "configure:8451: checking for setlocale in -lxpg4" >&5
+echo "configure:8454: 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
@@ -8455,7 +8458,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lxpg4  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8459 "configure"
+#line 8462 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8466,7 +8469,7 @@ int main() {
 setlocale()
 ; return 0; }
 EOF
-if { (eval echo configure:8470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8473: \"$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
@@ -8489,7 +8492,7 @@ fi
 
 
 echo $ac_n "checking for getpwnam in -lsun""... $ac_c" 1>&6
-echo "configure:8493: checking for getpwnam in -lsun" >&5
+echo "configure:8496: 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
@@ -8497,7 +8500,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsun  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8501 "configure"
+#line 8504 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8508,7 +8511,7 @@ int main() {
 getpwnam()
 ; return 0; }
 EOF
-if { (eval echo configure:8512: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8515: \"$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
@@ -8536,7 +8539,7 @@ else
 fi
 
 echo $ac_n "checking for deflate in -lz""... $ac_c" 1>&6
-echo "configure:8540: checking for deflate in -lz" >&5
+echo "configure:8543: 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
@@ -8544,7 +8547,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lz  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8548 "configure"
+#line 8551 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8555,7 +8558,7 @@ int main() {
 deflate()
 ; return 0; }
 EOF
-if { (eval echo configure:8559: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8562: \"$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
@@ -8586,7 +8589,7 @@ fi
 
 PTHREAD_LIB=""
 echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
-echo "configure:8590: checking for pthread_create in -lpthread" >&5
+echo "configure:8593: 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
@@ -8594,7 +8597,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpthread  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8598 "configure"
+#line 8601 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8605,7 +8608,7 @@ int main() {
 pthread_create()
 ; return 0; }
 EOF
-if { (eval echo configure:8609: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8612: \"$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
@@ -8624,7 +8627,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:8628: checking for pthread_create in -lpthreads" >&5
+echo "configure:8631: 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
@@ -8632,7 +8635,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpthreads  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8636 "configure"
+#line 8639 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8643,7 +8646,7 @@ int main() {
 pthread_create()
 ; return 0; }
 EOF
-if { (eval echo configure:8647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8650: \"$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
@@ -8662,7 +8665,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:8666: checking for pthread_create in -lc_r" >&5
+echo "configure:8669: 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
@@ -8670,7 +8673,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lc_r  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8674 "configure"
+#line 8677 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8681,7 +8684,7 @@ int main() {
 pthread_create()
 ; return 0; }
 EOF
-if { (eval echo configure:8685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8688: \"$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
@@ -8700,12 +8703,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:8704: checking for pthread_create" >&5
+echo "configure:8707: 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 <<EOF
-#line 8709 "configure"
+#line 8712 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char pthread_create(); below.  */
@@ -8728,7 +8731,7 @@ pthread_create();
 
 ; return 0; }
 EOF
-if { (eval echo configure:8732: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8735: \"$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
@@ -9069,7 +9072,11 @@ trap 'rm -fr `echo "autoconf/Make.common \
           src/cats/grant_mysql_privileges \
           src/cats/make_sqlite_tables \
           src/cats/drop_sqlite_tables \
+          src/cats/create_sqlite_database \
           src/cats/sqlite \
+          src/cats/create_bdb_database \
+          src/cats/make_bdb_tables \
+          src/cats/drop_bdb_tables \
           src/findlib/Makefile \
           $PFILES  src/config.h:autoconf/config.h.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
 EOF
@@ -9208,10 +9215,11 @@ s%@sd_port@%$sd_port%g
 s%@dir_password@%$dir_password%g
 s%@fd_password@%$fd_password%g
 s%@sd_password@%$sd_password%g
-s%@cats@%$cats%g
 s%@SQL_LFLAGS@%$SQL_LFLAGS%g
 s%@SQL_INCLUDE@%$SQL_INCLUDE%g
 s%@SQL_BINDIR@%$SQL_BINDIR%g
+s%@cats@%$cats%g
+s%@DB_NAME@%$DB_NAME%g
 s%@EXEEXT@%$EXEEXT%g
 s%@X_CFLAGS@%$X_CFLAGS%g
 s%@X_PRE_LIBS@%$X_PRE_LIBS%g
@@ -9303,7 +9311,11 @@ CONFIG_FILES=\${CONFIG_FILES-"autoconf/Make.common \
           src/cats/grant_mysql_privileges \
           src/cats/make_sqlite_tables \
           src/cats/drop_sqlite_tables \
+          src/cats/create_sqlite_database \
           src/cats/sqlite \
+          src/cats/create_bdb_database \
+          src/cats/make_bdb_tables \
+          src/cats/drop_bdb_tables \
           src/findlib/Makefile \
           $PFILES "}
 EOF
@@ -9496,8 +9508,10 @@ 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 src/cats/drop_sqlite_tables 
+chmod 755 src/cats/create_sqlite_database
 chmod 755 src/cats/sqlite
-
+chmod 755 src/cats/make_bdb_tables src/cats/drop_bdb_tables 
+chmod 755 src/cats/create_bdb_database
 
 echo "
 Configuration on `date`:
index 4262b4a050b06bfc5230d971e32efdb3787c4d57..0b9213125aacf9c77210f72928e44cf5e83cfe11 100644 (file)
 # define __PROTO(p)     ()
 #endif
 
-/* #define ASSERT(x) if (!(x)) Emsg1(M_ABORT, 0, "Failed ASSERT: %s\n", __STRING(x)) */
+#ifdef DEBUG
 #define ASSERT(x) if (!(x)) { \
    char *jcr = NULL; \
    Emsg1(M_ERROR, 0, "Failed ASSERT: %s\n", #x); \
    jcr[0] = 0; }
+#else
+#define ASSERT(x)
+#endif
 
 /* Allow printing of NULL pointers */
 #define NPRT(x) (x)?(x):"*None*" 
@@ -200,6 +203,24 @@ extern void _v(char *file, int line, pthread_mutex_t *m);
 #define Dmsg12(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12)
 #define Dmsg13(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13)
 #endif /* DEBUG */
+
+
+/* Messages that are printed (uses d_msg) */
+#define Pmsg0(lvl, msg)             d_msg(__FILE__, __LINE__, lvl, msg)
+#define Pmsg1(lvl, msg, a1)         d_msg(__FILE__, __LINE__, lvl, msg, a1)
+#define Pmsg2(lvl, msg, a1, a2)     d_msg(__FILE__, __LINE__, lvl, msg, a1, a2)
+#define Pmsg3(lvl, msg, a1, a2, a3) d_msg(__FILE__, __LINE__, lvl, msg, a1, a2, a3)
+#define Pmsg4(lvl, msg, arg1, arg2, arg3, arg4) d_msg(__FILE__, __LINE__, lvl, msg, arg1, arg2, arg3, arg4)
+#define Pmsg5(lvl, msg, a1, a2, a3, a4, a5) d_msg(__FILE__, __LINE__, lvl, msg, a1, a2, a3, a4, a5)
+#define Pmsg6(lvl, msg, a1, a2, a3, a4, a5, a6) d_msg(__FILE__, __LINE__, lvl, msg, a1, a2, a3, a4, a5, a6)
+#define Pmsg7(lvl, msg, a1, a2, a3, a4, a5, a6, a7) d_msg(__FILE__, __LINE__, lvl, msg, a1, a2, a3, a4, a5, a6, a7)
+#define Pmsg8(lvl, msg, a1, a2, a3, a4, a5, a6, a7, a8) d_msg(__FILE__, __LINE__, lvl, msg, a1, a2, a3, a4, a5, a6, a7, a8)
+#define Pmsg9(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9) d_msg(__FILE__,__LINE__,lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9)
+#define Pmsg10(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) d_msg(__FILE__,__LINE__,lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)
+#define Pmsg11(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11) d_msg(__FILE__,__LINE__,lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)
+#define Pmsg12(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12) d_msg(__FILE__,__LINE__,lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12)
+#define Pmsg13(lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13) d_msg(__FILE__,__LINE__,lvl,msg,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13)
+
        
 /* Daemon Error Messages that are delivered according to the message resource */
 #define Emsg0(typ, lvl, msg)             e_msg(__FILE__, __LINE__, typ, lvl, msg)
index 4478ee95aed5cf371dfb629cd7d4a9bf241608af..3be938d7cf314713b7f18b3e10aaf5fa8ef89811 100644 (file)
@@ -62,20 +62,21 @@ realclean: clean
        $(RMF) tags
        $(RMF) make_mysql_tables grant_mysql_privileges drop_mysql_tables
        $(RMF) create_mysql_database make_sqlite_tables sqlite
+       $(RMF) create_bdb_database drop_bdb_tables make_dbd_tables
 
 distclean: realclean
        if test $(srcdir) = .; then $(MAKE) realclean; fi
        (cd $(srcdir); $(RMF) Makefile)
 
 install:
-       $(INSTALL_SCRIPT) create_mysql_database $(DESTDIR)$(sysconfdir)/create_mysql_database
-       $(INSTALL_SCRIPT) drop_mysql_tables $(DESTDIR)$(sysconfdir)/drop_mysql_tables
-       $(INSTALL_SCRIPT) make_mysql_tables $(DESTDIR)$(sysconfdir)/make_mysql_tables
+       $(INSTALL_SCRIPT) create_@DB_NAME@_database $(DESTDIR)$(sysconfdir)/create_@DB_NAME@_database
+       $(INSTALL_SCRIPT) drop_@DB_NAME@_tables $(DESTDIR)$(sysconfdir)/drop_@DB_NAME@_tables
+       $(INSTALL_SCRIPT) make_@DB_NAME@_tables $(DESTDIR)$(sysconfdir)/make_@DB_NAME@_tables
 
 uninstall:
-       (cd $(DESTDIR)$(sysconfdir); $(RMF) create_mysql_database)
-       (cd $(DESTDIR)$(sysconfdir); $(RMF) drop_mysql_tables)
-       (cd $(DESTDIR)$(sysconfdir); $(RMF) make_mysql_tables)
+       (cd $(DESTDIR)$(sysconfdir); $(RMF) create_@DB_NAME@_database)
+       (cd $(DESTDIR)$(sysconfdir); $(RMF) drop_@DB_NAME@_tables)
+       (cd $(DESTDIR)$(sysconfdir); $(RMF) make_@DB_NAME@_tables)
 
 
 # Semi-automatic generation of dependencies:
index eee4ea7b188de2f365b9dd2e1aff2651cb7f77bf..d9838b0adf9d1bb4b9b8b19326136a899af0d885 100644 (file)
@@ -177,7 +177,7 @@ int db_find_next_volume(B_DB *mdb, int item, MEDIA_DBR *mr)
    return stat;                
 }
 
-int db_find_last_full_verify(B_DB *mdb, JOB_DBR *jr) { return 0; }
+int db_find_last_jobid(B_DB *mdb, JOB_DBR *jr) { return 0; }
 
 
 #endif /* HAVE_BACULA_DB */
index 8b0f0ea2f503489f4838b80587f7423067a24d2e..9a474576fb1245198511351029e30f577fd4ef67 100755 (executable)
@@ -197,7 +197,7 @@ int db_add_MD5_to_file_record(B_DB *mdb, FileId_t FileId, char *MD5)
    return 1;
 }
 
-int db_mark_file_record(B_DB *mdb, FileId_t FileId, int JobId) 
+int db_mark_file_record(B_DB *mdb, FileId_t FileId, JobId_t JobId)
 { 
    return 1;
 }
index b3946a61e457ab053b9852e8dc1718d0034e97a5..1d05775664e358463d23afa0b6985ffbcac590ed 100644 (file)
@@ -44,28 +44,11 @@ typedef int (DB_RESULT_HANDLER)(void *, int, char **);
 #define db_lock(mdb)   _db_lock(__FILE__, __LINE__, mdb)
 #define db_unlock(mdb) _db_unlock(__FILE__, __LINE__, mdb)
 
-#ifdef xxxxx_old_way_of_doing_it
-#define db_lock(mdb)   P(mdb->mutex)
-#define db_unlock(mdb) V(mdb->mutex)
-#define db_lock(mdb) \
-   do { int errstat; if ((errstat=rwl_writelock(&(mdb->lock)))) \
-      e_msg(__FILE__, __LINE__, M_ABORT, 0, "rwl_writelock failure. ERR=%s\n",\
-           strerror(errstat)); \
-   } while(0)
-
-#define db_unlock(x) \
-   do { int errstat; if ((errstat=rwl_writeunlock(&(mdb->lock)))) \
-         e_msg(__FILE__, __LINE__, M_ABORT, 0, "rwl_writeunlock failure. ERR=%s\n",\
-           strerror(errstat)); \
-   } while(0)
-#endif
-
 #ifdef __SQL_C
 
 #ifdef HAVE_SQLITE
 
-#define BDB_VERSION 1
+#define BDB_VERSION 2
 
 #include <sqlite.h>
 
@@ -93,7 +76,6 @@ typedef struct s_sql_field {
  */
 typedef struct s_db {
    BQUEUE bq;                         /* queue control */
-/* pthread_mutex_t mutex; */
    brwlock_t lock;                    /* transaction lock */
    struct sqlite *db;
    char **result;
@@ -149,7 +131,7 @@ extern void my_sqlite_free_table(B_DB *mdb);
 
 #ifdef HAVE_MYSQL
 
-#define BDB_VERSION 1
+#define BDB_VERSION 2
 
 #include <mysql.h>
 
@@ -162,7 +144,6 @@ extern void my_sqlite_free_table(B_DB *mdb);
  */
 typedef struct s_db {
    BQUEUE bq;                         /* queue control */
-/* pthread_mutex_t mutex; */
    brwlock_t lock;                    /* transaction lock */
    MYSQL mysql;
    MYSQL *db;
@@ -354,6 +335,7 @@ typedef struct {
    JobId_t  JobId;
    uint32_t FilenameId;
    uint32_t PathId;
+   JobId_t  MarkId;
    char LStat[256];
 /*   int Status; */
    char MD5[50];
@@ -383,9 +365,9 @@ typedef struct {
    char VolumeName[MAX_NAME_LENGTH];  /* Volume name */
    char MediaType[MAX_NAME_LENGTH];   /* Media type */
    uint32_t PoolId;                   /* Pool id */
-   time_t FirstWritten;               /* Time Volume first written */
-   time_t LastWritten;                /* Time Volume last written */
-   time_t LabelDate;                  /* Date/Time Volume labelled */
+   time_t   FirstWritten;             /* Time Volume first written */
+   time_t   LastWritten;              /* Time Volume last written */
+   time_t   LabelDate;                /* Date/Time Volume labelled */
    uint32_t VolJobs;                  /* number of jobs on this medium */
    uint32_t VolFiles;                 /* Number of files */
    uint32_t VolBlocks;                /* Number of blocks */
@@ -397,7 +379,8 @@ typedef struct {
    uint64_t VolMaxBytes;              /* max bytes to write */
    uint64_t VolCapacityBytes;         /* capacity estimate */
    btime_t  VolRetention;             /* Volume retention in seconds */
-   int Recycle;                       /* recycle yes/no */
+   int      Recycle;                  /* recycle yes/no */
+   int32_t  Slot;                     /* slot in changer */
    char VolStatus[20];                /* Volume status */
    /* Extra stuff not in DB */
    faddr_t rec_addr;                  /* found record address */
diff --git a/bacula/src/cats/create_bdb_database.in b/bacula/src/cats/create_bdb_database.in
new file mode 100644 (file)
index 0000000..4313515
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+#
+# shell script to create Bacula database(s)
+#
+#  Nothing to do 
index f0bae06f484dede67f7b556d4f79e9e7178e5d95..4313515899088665150282f0e3618be3f383aed8 100644 (file)
@@ -2,15 +2,4 @@
 #
 # shell script to create Bacula database(s)
 #
-
-bindir=@SQL_BINDIR@
-
-if $bindir/mysql -f <<END-OF-DATA
-CREATE DATABASE bacula;
-END-OF-DATA
-then
-   echo "Creation of bacula database succeeded."
-else
-   echo "Creation of bacula database failed."
-fi
-exit 0
+#  Nothing to do 
diff --git a/bacula/src/cats/create_sqlite_database.in b/bacula/src/cats/create_sqlite_database.in
new file mode 100644 (file)
index 0000000..4313515
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+#
+# shell script to create Bacula database(s)
+#
+#  Nothing to do 
diff --git a/bacula/src/cats/drop_bdb_tables.in b/bacula/src/cats/drop_bdb_tables.in
new file mode 100644 (file)
index 0000000..9c27241
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+#
+# shell script to Delete the Bacula database (same as deleting 
+#  the tables)
+#
+
+rm -f @working_dir@/control.db
+rm -f @working_dir@/jobs.db
+rm -f @working_dir@/pools.db
+rm -f @working_dir@/media.db
+rm -f @working_dir@/jobmedia.db
+rm -f @working_dir@/client.db
+rm -f @working_dir@/fileset.db
diff --git a/bacula/src/cats/make_bdb_tables.in b/bacula/src/cats/make_bdb_tables.in
new file mode 100644 (file)
index 0000000..246edb9
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh
+#
+# shell script to create Bacula tables
+#
+# Nothing to do -- created by Bacula
+#
index c5acf7a08ac694212ecba64a58f7a3d470aa1fd9..5cd52b9a05b4b9356b9a7fa41688e2de139bcac6 100644 (file)
@@ -1,7 +1,7 @@
 #!/bin/sh
 #
-# shell script to create Bacula tables
-
+# shell script to create Bacula MySQL tables
+#
 bindir=@SQL_BINDIR@
 
 if $bindir/mysql -f <<END-OF-DATA
@@ -28,6 +28,7 @@ CREATE TABLE File (
    JobId INTEGER UNSIGNED NOT NULL REFERENCES Job,
    PathId INTEGER UNSIGNED NOT NULL REFERENCES Path,
    FilenameId INTEGER NOT NULL REFERENCES Filename,
+   MarkId INTEGER UNSIGNED NOT NULL DEFAULT 0,
    LStat TINYBLOB NOT NULL,
    MD5 TINYBLOB NOT NULL,
    PRIMARY KEY(FileId),
@@ -88,6 +89,7 @@ CREATE TABLE JobMedia (
 CREATE TABLE Media (
    MediaId INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
    VolumeName TINYBLOB NOT NULL,
+   Slot INTEGER NOT NULL,
    PoolId INTEGER UNSIGNED NOT NULL REFERENCES Pool,
    MediaType TINYBLOB NOT NULL,
    FirstWritten DATETIME NOT NULL,
@@ -144,8 +146,17 @@ CREATE TABLE Version (
    );
 
 -- Initialize Version           
-INSERT INTO Version (VersionId) VALUES (1);
-
+INSERT INTO Version (VersionId) VALUES (2);
+
+CREATE TABLE Counters {
+   Counter TINYBLOB NOT NULL,
+   PoolId INTEGER UNSIGNED REFERENCES Pool NOT NULL,
+   MinValue INTEGER,
+   MaxValue INTEGER,
+   CurrentValue INTEGER,
+   WrapCounter TINYBLOB NOT NULL,
+   PRIMARY KEY (Counter)
+   );
 
 ## Experimental
 #CREATE TABLE FileSave (
@@ -157,6 +168,26 @@ INSERT INTO Version (VersionId) VALUES (1);
 #   PRIMARY KEY(FileSaveId),
 #   );
 
+# Experimental stuff below. Not used.
+# Invariant part of File
+#CREATE TABLE BaseFile (
+#   FileId INTEGER UNSIGNED AUTOINCREMENT,
+#   PathId INTEGER UNSIGNED REFERENCES Path NOT NULL,
+#   FilenameId INTEGER REFERENCES Filename NOT NULL,
+#   LStat VARCHAR(255) NOT NULL,
+#   MD5 VARCHAR(25) NOT NULL,
+#   PRIMARY KEY(FileId) 
+#   );
+
+# Variable part of File
+#CREATE TABLE FileSave (
+#   FileId INTEGER UNSIGNED REFERENCES BaseFile NOT NULL,
+#   FileIndex INTEGER UNSIGNED NOT NULL,
+#   JobId INTEGER UNSIGNED REFERENCES Job NOT NULL,
+#   PRIMARY KEY(FileId) 
+#   );
+
+
 END-OF-DATA
 then
    echo "Creation of Bacula tables succeeded."
index 31b29ec9f690b1395cfe90c8350a471b29222963..57bd9b6c35fcd571e91b2898c53e826776067d0d 100644 (file)
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# shell script to create Bacula tables
+# shell script to create Bacula SQLite tables
 
 bindir=@SQL_BINDIR@
 cd @working_dir@
@@ -25,6 +25,7 @@ CREATE TABLE File (
    JobId INTEGER UNSIGNED REFERENCES Job NOT NULL,
    PathId INTEGER UNSIGNED REFERENCES Path NOT NULL,
    FilenameId INTEGER REFERENCES Filename NOT NULL,
+   MarkId INTEGER UNSIGNED DEFAULT 0,
    LStat VARCHAR(255) NOT NULL,
    MD5 VARCHAR(25) NOT NULL,
    PRIMARY KEY(FileId) 
@@ -78,6 +79,7 @@ CREATE TABLE JobMedia (
 CREATE TABLE Media (
    MediaId INTEGER UNSIGNED AUTOINCREMENT,
    VolumeName VARCHAR(128) NOT NULL,
+   Slot INTEGER DEFAULT 0,
    PoolId INTEGER UNSIGNED REFERENCES Pool NOT NULL,
    MediaType VARCHAR(128) NOT NULL,
    FirstWritten DATETIME DEFAULT 0,
@@ -141,28 +143,17 @@ CREATE TABLE Version (
    );
 
 -- Initialize Version           
-INSERT INTO Version (VersionId) VALUES (1);
+INSERT INTO Version (VersionId) VALUES (2);
 
-
--- Experimental stuff below. Not used.
--- Invariant part of File
-CREATE TABLE BaseFile (
-   FileId INTEGER UNSIGNED AUTOINCREMENT,
-   PathId INTEGER UNSIGNED REFERENCES Path NOT NULL,
-   FilenameId INTEGER REFERENCES Filename NOT NULL,
-   LStat VARCHAR(255) NOT NULL,
-   MD5 VARCHAR(25) NOT NULL,
-   PRIMARY KEY(FileId) 
-   );
-
--- Variable part of File
-CREATE TABLE FileSave (
-   FileId INTEGER UNSIGNED REFERENCES BaseFile NOT NULL,
-   FileIndex INTEGER UNSIGNED NOT NULL,
-   JobId INTEGER UNSIGNED REFERENCES Job NOT NULL,
-   PRIMARY KEY(FileId) 
+CREATE TABLE Counters (
+   Counter TEXT NOT NULL,     
+   PoolId INTEGER UNSIGNED REFERENCES Pool NOT NULL,
+   MinValue INTEGER DEFAULT 0, 
+   MaxValue INTEGER DEFAULT 0,
+   CurrentValue INTEGER DEFAULT 0,
+   WrapCounter TEXT NOT NULL,
+   PRIMARY KEY (Counter)
    );
 
-
 END-OF-DATA
 exit 0
index 3dd0d6780709e61b4d07ab1d33be97a467768e37..6ba7279403a90d413284d488a5865d57d22fcd6e 100644 (file)
@@ -200,9 +200,10 @@ db_close_database(B_DB *mdb)
  * For MySQL, NULL causes the auto-increment value
  *  to be updated.
  */
-char *db_next_index(B_DB *mdb, char *table)
+int db_next_index(B_DB *mdb, char *table, char *index)
 {
-   return "NULL";
+   strcpy(index, "NULL");
+   return 1;
 }   
 
 
@@ -271,6 +272,7 @@ list_result(B_DB *mdb, DB_LIST_HANDLER *send, void *ctx)
    char buf[2000], ewc[30];
 
    if (mdb->result == NULL) {
+      send(ctx, _("No results to list.\n"));
       return;
    }
    /* determine column display widths */
index fbaf15b8affb7135b94cfed41dbe48fdf08dc7fa..c3ca48c5a33478d04ad4f068965a6273ab632ff8 100644 (file)
@@ -36,7 +36,7 @@ void db_close_database(B_DB *db);
 void db_escape_string(char *snew, char *old, int len);
 char *db_strerror(B_DB *mdb);
 int get_sql_record_max(B_DB *mdb);
-char *db_next_index(B_DB *mdb, char *table);
+int db_next_index(B_DB *mdb, char *table, char *index);
 int db_sql_query(B_DB *mdb, char *cmd, DB_RESULT_HANDLER *result_handler, void *ctx);
 int check_tables_version(B_DB *mdb);
 void _db_unlock(char *file, int line, B_DB *mdb);
@@ -57,7 +57,7 @@ int db_delete_media_record(B_DB *mdb, MEDIA_DBR *mr);
 
 /* find.c */
 int db_find_job_start_time(B_DB *mdb, JOB_DBR *jr, char *stime);
-int db_find_last_full_verify(B_DB *mdb, JOB_DBR *jr);
+int db_find_last_jobid(B_DB *mdb, JOB_DBR *jr);
 int db_find_next_volume(B_DB *mdb, int index, MEDIA_DBR *mr);
 
 /* get.c */
@@ -89,6 +89,6 @@ int  db_update_job_end_record(B_DB *db, JOB_DBR *jr);
 int  db_update_pool_record(B_DB *db, POOL_DBR *pr);
 int  db_update_media_record(B_DB *db, MEDIA_DBR *mr);
 int  db_add_MD5_to_file_record(B_DB *mdb, FileId_t FileId, char *MD5);  
-int  db_mark_file_record(B_DB *mdb, FileId_t FileId, int JobId);
+int  db_mark_file_record(B_DB *mdb, FileId_t FileId, JobId_t JobId);
 
 #endif /* __SQL_PROTOS_H */
index 04768c323404d19538356a254df5058c4461bd34..d6eee63df0b3258840b724468d19f5fec0f59cf5 100644 (file)
@@ -69,7 +69,7 @@ db_create_job_record(B_DB *mdb, JOB_DBR *jr)
    time_t stime;
    struct tm tm;
    int stat;
-   char *JobId;
+   char JobId[30];
    btime_t JobTDate;
    char ed1[30];
 
@@ -80,8 +80,7 @@ db_create_job_record(B_DB *mdb, JOB_DBR *jr)
    JobTDate = (btime_t)stime;
 
    db_lock(mdb);
-   JobId = db_next_index(mdb, "Job");
-   if (!JobId) {
+   if (!db_next_index(mdb, "Job", JobId)) {
       jr->JobId = 0;
       db_unlock(mdb);
       return 0;
index bc558ac20fa2c272fe266edc37d483fce92a6cb9..7da8ecd7b7aad6125275749653c6ceaa10252469 100644 (file)
@@ -133,32 +133,42 @@ ORDER by StartTime DESC LIMIT 1",
 }
 
 /* 
- * Find JobId of last full verify 
+ * Find JobId of last job that ran.  E.g. for
+ *   VERIFY_CATALOG we want the JobId of the last INIT.
+ *   For VERIFY_VOLUME_TO_CATALOG, we want the JobId of the last Job.
+ *
  * Returns: 1 on success
  *         0 on failure
  */
 int
-db_find_last_full_verify(B_DB *mdb, JOB_DBR *jr)
+db_find_last_jobid(B_DB *mdb, JOB_DBR *jr)
 {
    SQL_ROW row;
 
    /* Find last full */
    db_lock(mdb);
-   if (jr->Level != L_VERIFY_CATALOG) {
-      Mmsg2(&mdb->errmsg, _("Expecting Level=%c, got %c\n"), L_VERIFY_CATALOG, jr->Level);
+   if (jr->Level == L_VERIFY_CATALOG) {
+      Mmsg(&mdb->cmd, 
+"SELECT JobId FROM Job WHERE Type='%c' AND Level='%c' AND Name=\"%s\" AND \
+ClientId=%d ORDER BY StartTime DESC LIMIT 1",
+          JT_VERIFY, L_VERIFY_INIT, jr->Name, jr->ClientId);
+   } else if (jr->Level == L_VERIFY_VOLUME_TO_CATALOG) {
+      Mmsg(&mdb->cmd, 
+"SELECT JobId FROM Job WHERE Type='%c' AND \
+ClientId=%d ORDER BY StartTime DESC LIMIT 1",
+          JT_BACKUP, jr->ClientId);
+   } else {
+      Mmsg1(&mdb->errmsg, _("Unknown Job level=%c\n"), jr->Level);
+      db_unlock(mdb);
       return 0;
    }
-   Mmsg(&mdb->cmd, 
-"SELECT JobId from Job WHERE Type='%c' and Level='%c' and Name=\"%s\" and \
-ClientId=%d ORDER by StartTime DESC LIMIT 1",
-          JT_VERIFY, L_VERIFY_INIT, jr->Name, jr->ClientId);
 
    if (!QUERY_DB(mdb, mdb->cmd)) {
       db_unlock(mdb);
       return 0;
    }
    if ((row = sql_fetch_row(mdb)) == NULL) {
-      Mmsg0(&mdb->errmsg, _("No Job found for last full verify.\n"));
+      Mmsg1(&mdb->errmsg, _("No Job found for: %s.\n"), mdb->cmd);
       sql_free_result(mdb);
       db_unlock(mdb);
       return 0;
@@ -167,9 +177,9 @@ ClientId=%d ORDER by StartTime DESC LIMIT 1",
    jr->JobId = atoi(row[0]);
    sql_free_result(mdb);
 
-   Dmsg1(100, "db_get_last_full_verify: got JobId=%d\n", jr->JobId);
+   Dmsg1(100, "db_get_last_jobid: got JobId=%d\n", jr->JobId);
    if (jr->JobId <= 0) {
-      Mmsg1(&mdb->errmsg, _("No Verify Job found for: %s\n"), mdb->cmd);
+      Mmsg1(&mdb->errmsg, _("No Job found for: %s\n"), mdb->cmd);
       db_unlock(mdb);
       return 0;
    }
index ca5f868a66882b6ff5992c43d98787d7b8af95c7..8d26335ffa046f154bf76053bf07d65ca9b72fd0 100644 (file)
@@ -311,11 +311,11 @@ int db_get_job_record(B_DB *mdb, JOB_DBR *jr)
    db_lock(mdb);
    if (jr->JobId == 0) {
       Mmsg(&mdb->cmd, "SELECT VolSessionId, VolSessionTime, \
-PoolId, StartTime, EndTime, JobFiles, JobBytes, JobTDate, Job \
+PoolId, StartTime, EndTime, JobFiles, JobBytes, JobTDate, Job, JobStatus \
 FROM Job WHERE Job=\"%s\"", jr->Job);
     } else {
       Mmsg(&mdb->cmd, "SELECT VolSessionId, VolSessionTime, \
-PoolId, StartTime, EndTime, JobFiles, JobBytes, JobTDate, Job \
+PoolId, StartTime, EndTime, JobFiles, JobBytes, JobTDate, Job, JobStatus \
 FROM Job WHERE JobId=%d", jr->JobId);
     }
 
@@ -339,6 +339,7 @@ FROM Job WHERE JobId=%d", jr->JobId);
    jr->JobBytes = (uint64_t)strtod(row[6], NULL);
    jr->JobTDate = (btime_t)strtod(row[7], NULL);
    strcpy(jr->Job, row[8]);
+   jr->JobStatus = (int)*row[9];
    sql_free_result(mdb);
 
    db_unlock(mdb);
index 5c646f0ea89ac45538c8a236e5a4442125a17642..1707a84b5509b3ed29a7223238220250743d05fa 100644 (file)
@@ -67,14 +67,14 @@ db_add_MD5_to_file_record(B_DB *mdb, FileId_t FileId, char *MD5)
 }
 
 /* Mark the file record as being visited during database
- * verify compare. Stuff JobId into FileIndex field
+ * verify compare. Stuff JobId into MarkedId field
  */
-int db_mark_file_record(B_DB *mdb, FileId_t FileId, int JobId) 
+int db_mark_file_record(B_DB *mdb, FileId_t FileId, JobId_t JobId) 
 {
    int stat;
 
    db_lock(mdb);
-   Mmsg(&mdb->cmd, "UPDATE File SET FileIndex=%d WHERE FileId=%d", JobId, FileId);
+   Mmsg(&mdb->cmd, "UPDATE File SET MarkId=%d WHERE FileId=%d", JobId, FileId);
    stat = UPDATE_DB(mdb, mdb->cmd);
    db_unlock(mdb);
    return stat;
index e4969aad7cff4d6cf2bf5da3be21f50c7fc5bcf9..4dc485aed370090c527eab923368a132af87ddb0 100644 (file)
@@ -106,16 +106,9 @@ db_open_database(B_DB *mdb)
       return 1;
    }
    mdb->connected = FALSE;
-#ifdef needed
-   if (pthread_mutex_init(&mdb->mutex, NULL) != 0) {
-      Mmsg1(&mdb->errmsg, _("Unable to initialize DB mutex. ERR=%s\n"), strerror(errno));
-      V(mutex);
-      return 0;
-   }
-#endif
 
    if (rwl_init(&mdb->lock) != 0) {
-      Mmsg1(&mdb->errmsg, "Unable to initialize DB lock. ERR=%s\n", strerror(errno));
+      Mmsg1(&mdb->errmsg, _("Unable to initialize DB lock. ERR=%s\n"), strerror(errno));
       V(mutex);
       return 0;
    }
@@ -169,7 +162,6 @@ db_close_database(B_DB *mdb)
       if (mdb->connected && mdb->db) {
         sqlite_close(mdb->db);
       }
-/*    pthread_mutex_destroy(&mdb->mutex); */
       rwl_destroy(&mdb->lock);      
       free_pool_memory(mdb->errmsg);
       free_pool_memory(mdb->cmd);
@@ -184,44 +176,41 @@ db_close_database(B_DB *mdb)
 
 /*
  * Return the next unique index (auto-increment) for
- * the given table.  Return NULL on error.
+ * the given table.  Return 0 on error.
  */
-char *db_next_index(B_DB *mdb, char *table)
+int db_next_index(B_DB *mdb, char *table, char *index)
 {
    SQL_ROW row;
-   static char id[20];
 
-   QUERY_DB(mdb, "BEGIN TRANSACTION");
-   sql_free_result(mdb);
+   db_lock(mdb);
 
    Mmsg(&mdb->cmd,
 "SELECT id FROM NextId WHERE TableName=\"%s\"", table);
    if (!QUERY_DB(mdb, mdb->cmd)) {
       Mmsg(&mdb->errmsg, _("next_index query error: ERR=%s\n"), sql_strerror(mdb));
-      QUERY_DB(mdb, "ROLLBACK");
-      return NULL;
+      db_unlock(mdb);
+      return 0;
    }
    if ((row = sql_fetch_row(mdb)) == NULL) {
       Mmsg(&mdb->errmsg, _("Error fetching index: ERR=%s\n"), sql_strerror(mdb));
-      QUERY_DB(mdb, "ROLLBACK");
-      return NULL;
+      db_unlock(mdb);
+      return 0;
    }
-   strncpy(id, row[0], sizeof(id));
-   id[sizeof(id)-1] = 0;
+   strncpy(index, row[0], 28);
+   index[28] = 0;
    sql_free_result(mdb);
 
    Mmsg(&mdb->cmd,
 "UPDATE NextId SET id=id+1 WHERE TableName=\"%s\"", table);
    if (!QUERY_DB(mdb, mdb->cmd)) {
       Mmsg(&mdb->errmsg, _("next_index update error: ERR=%s\n"), sql_strerror(mdb));
-      QUERY_DB(mdb, "ROLLBACK");
-      return NULL;
+      db_unlock(mdb);
+      return 0;
    }
    sql_free_result(mdb);
 
-   QUERY_DB(mdb, "COMMIT");
-   sql_free_result(mdb);
-   return id;
+   db_unlock(mdb);
+   return 1;
 }   
 
 
@@ -412,6 +401,7 @@ list_result(B_DB *mdb, DB_LIST_HANDLER *send, void *ctx)
    char buf[2000], ewc[30];
 
    if (mdb->result == NULL || mdb->nrow == 0) {
+      send(ctx, _("No results to list.\n"));
       return;
    }
    /* determine column display widths */
index f20c683fc9a313240e0edc83129be1c88d7c11cc..fe0aac5b2f1212668d8ab0e6ce24c085a829e2ff 100644 (file)
@@ -52,6 +52,7 @@ static char *configfile = NULL;
 static BSOCK *UA_sock = NULL;
 static DIRRES *dir; 
 static FILE *output = stdout;
+static int stop = FALSE;
 
 
 #define CONFIG_FILE "./console.conf"   /* default configuration file */
@@ -71,6 +72,28 @@ static void usage()
    exit(1);
 }
 
+
+void got_stop(int sig)
+{
+   stop = TRUE;
+}
+
+void got_continue(int sig)
+{
+   stop = FALSE;
+}
+
+void got_tout(int sig) 
+{
+// printf("Got tout\n");
+}
+
+void got_tin(int sig)
+{   
+// printf("Got tin\n");
+}
+
+
 static void read_and_process_input(FILE *input, BSOCK *UA_sock) 
 {
    char *prompt = "*";
@@ -112,12 +135,18 @@ static void read_and_process_input(FILE *input, BSOCK *UA_sock)
       }
       while ((stat = bnet_recv(UA_sock)) > 0) {
         if (at_prompt) {
-            fprintf(output, "\n");
+           if (!stop) {
+               fprintf(output, "\n");
+           }
            at_prompt = FALSE;
         }
-         printf("%s", UA_sock->msg);
+        if (!stop) {
+            fprintf(output, "%s", UA_sock->msg);
+        }
+      }
+      if (!stop) {
+        fflush(output);
       }
-      fflush(output);
       if (stat < 0) {
         break;                       /* error */
       } else if (stat == 0) {
@@ -182,6 +211,10 @@ int main(int argc, char *argv[])
       init_signals(terminate_console);
    }
    signal(SIGCHLD, SIG_IGN);
+   signal(SIGTSTP, got_stop);
+   signal(SIGCONT, got_continue);
+   signal(SIGTTIN, got_tin);
+   signal(SIGTTOU, got_tout);
 
    if (argc) {
       usage();
@@ -353,8 +386,11 @@ int
 get_cmd(FILE *input, char *prompt, BSOCK *sock, int sec)
 {
    int len;  
-   fprintf(output, prompt);
-   fflush(output);
+   if (!stop) {
+      fprintf(output, prompt);
+      fflush(output);
+   }
+again:
    switch (wait_for_data(fileno(input), sec)) {
       case 0:
         return 0;                    /* timeout */
@@ -362,6 +398,9 @@ get_cmd(FILE *input, char *prompt, BSOCK *sock, int sec)
         return -1;                   /* error */
       default:
         len = sizeof_pool_memory(sock->msg) - 1;
+        if (stop) {
+           goto again;
+        }
         if (fgets(sock->msg, len, input) == NULL) {
            return -1;
         }
index 5f545b0a8f616ccdefd7d73ba764cb26cd5b0fec..89850d6000311715fe5c0edd072e894f29d3fde5 100755 (executable)
@@ -4,5 +4,5 @@ touch 1
 for i in . console gnome-console cats dird filed findlib lib stored; do
   ls -1 $i/*.c $i/*.h $i/*.in >>1
 done
-cat 1 | lines
+cat 1 | $HOME/bin/lines
 # rm -f 1
index 64f38888e4dab7f4f47dd69af736c22ad159c5bf..c9cf645d407b050a14c9487fc033b560354476c2 100644 (file)
@@ -74,7 +74,7 @@ int do_autoprune(JCR *jcr)
 
    if (jcr->job->PruneJobs || jcr->client->AutoPrune) {
       Jmsg(jcr, M_INFO, 0, _("Begin pruning Jobs.\n"));
-      prune_jobs(&ua, client);
+      prune_jobs(&ua, client, jcr->JobType);
       pruned = TRUE;
    } else {
       pruned = FALSE;
index aca3aa1b30d9e82babccd04389884ac3400b6afb..d0c2abc2a57c12983696c24c68d8ece323170929 100644 (file)
@@ -74,10 +74,11 @@ int do_backup(JCR *jcr)
    since[0] = 0;
 
    if (!get_or_create_client_record(jcr)) {
-      backup_cleanup(jcr, JS_ErrorTerminated, since);
+      Jmsg(jcr, M_ERROR, 0, _("Could not get/create Client record. ERR=%s\n"), 
+        db_strerror(jcr->db));
+      goto bail_out;
    }
 
-
    /*
     * Get or Create FileSet record
     */
@@ -93,21 +94,19 @@ int do_backup(JCR *jcr)
       Jmsg(jcr, M_WARNING, 0, _("FileSet MD5 signature not found.\n"));
    }
    if (!db_create_fileset_record(jcr->db, &fsr)) {
-      Jmsg(jcr, M_ERROR, 0, _("Could not create FileSet record. %s"), 
+      Jmsg(jcr, M_ERROR, 0, _("Could not create FileSet record. ERR=%s\n"), 
         db_strerror(jcr->db));
-      backup_cleanup(jcr, JS_ErrorTerminated, since);
-      return 0;
+      goto bail_out;
    }   
    jcr->jr.FileSetId = fsr.FileSetId;
    Dmsg2(9, "Created FileSet %s record %d\n", jcr->fileset->hdr.name, 
       jcr->jr.FileSetId);
 
-
    /* Look up the last
     * FULL backup job to get the time/date for a 
     * differential or incremental save.
     */
-   jcr->stime = (char *) get_pool_memory(PM_MESSAGE);
+   jcr->stime = get_pool_memory(PM_MESSAGE);
    jcr->stime[0] = 0;
    since[0] = 0;
    switch (jcr->JobLevel) {
@@ -117,8 +116,7 @@ int do_backup(JCR *jcr)
         jcr->jr.JobId = 0;
         if (!db_find_job_start_time(jcr->db, &jcr->jr, jcr->stime)) {
             Jmsg(jcr, M_INFO, 0, _("Last FULL backup time not found. Doing FULL backup.\n"));
-           jcr->JobLevel = L_FULL;
-           jcr->jr.Level = L_FULL;
+           jcr->JobLevel = jcr->jr.Level = L_FULL;
         } else {
             strcpy(since, ", since=");
            strcat(since, jcr->stime);
@@ -131,8 +129,7 @@ int do_backup(JCR *jcr)
    jcr->jr.StartTime = jcr->start_time;
    if (!db_update_job_start_record(jcr->db, &jcr->jr)) {
       Jmsg(jcr, M_ERROR, 0, "%s", db_strerror(jcr->db));
-      backup_cleanup(jcr, JS_ErrorTerminated, since);
-      return 0;
+      goto bail_out;
    }
 
    jcr->fname = (char *) get_pool_memory(PM_FNAME);
@@ -151,8 +148,7 @@ int do_backup(JCR *jcr)
       if (create_pool(jcr->db, jcr->pool) < 0) {
          Jmsg(jcr, M_FATAL, 0, _("Pool %s not in database. %s"), pr.Name, 
            db_strerror(jcr->db));
-        backup_cleanup(jcr, JS_ErrorTerminated, since);
-        return 0;
+        goto bail_out;
       } else {
          Jmsg(jcr, M_INFO, 0, _("Pool %s created in database.\n"), pr.Name);
       }
@@ -160,27 +156,6 @@ int do_backup(JCR *jcr)
    jcr->PoolId = pr.PoolId;              /****FIXME**** this can go away */
    jcr->jr.PoolId = pr.PoolId;
 
-#ifdef needed
-   /* NOTE, THIS IS NOW DONE BY THE STORAGE DAEMON
-    *
-    * Find at least one Volume associated with this Pool
-    *  It must be marked Append, and be of the correct Media Type
-    *  for the storage type.
-    */
-   memset(&mr, 0, sizeof(mr));
-   mr.PoolId = pr.PoolId;
-   strcpy(mr.VolStatus, "Append");
-   strcpy(mr.MediaType, jcr->store->media_type);
-   if (!db_find_next_volume(jcr->db, 1, &mr)) {
-      if (!newVolume(jcr)) {
-         Jmsg(jcr, M_FATAL, 0, _("No writable %s media in Pool %s.\n\
-      Please use the Console program to add available Volumes.\n"), mr.MediaType, pr.Name);
-        backup_cleanup(jcr, JS_ErrorTerminated, since);
-        return 0;
-      }
-   }
-#endif
-
    /*
     * Open a message channel connection with the Storage
     * daemon. This is to let him know that our client
@@ -193,42 +168,36 @@ int do_backup(JCR *jcr)
     * Start conversation with Storage daemon  
     */
    if (!connect_to_storage_daemon(jcr, 10, SDConnectTimeout, 1)) {
-      backup_cleanup(jcr, JS_ErrorTerminated, since);
-      return 0;
+      goto bail_out;
    }
    /*
     * Now start a job with the Storage daemon
     */
    if (!start_storage_daemon_job(jcr)) {
-      backup_cleanup(jcr, JS_ErrorTerminated, since);
-      return 0;
+      goto bail_out;
    }
    /*
     * Now start a Storage daemon message thread
     */
    if (!start_storage_daemon_message_thread(jcr)) {
-      backup_cleanup(jcr, JS_ErrorTerminated, since);
-      return 0;
+      goto bail_out;
    }
-
    Dmsg0(50, "Storage daemon connection OK\n");
 
+   jcr->JobStatus = JS_Blocked;
    if (!connect_to_file_daemon(jcr, 10, FDConnectTimeout, 1)) {
-      backup_cleanup(jcr, JS_ErrorTerminated, since);
-      return 0;
+      goto bail_out;
    }
 
    jcr->JobStatus = JS_Running;
    fd = jcr->file_bsock;
 
    if (!send_include_list(jcr)) {
-      backup_cleanup(jcr, JS_ErrorTerminated, since);
-      return 0;
+      goto bail_out;
    }
 
    if (!send_exclude_list(jcr)) {
-      backup_cleanup(jcr, JS_ErrorTerminated, since);
-      return 0;
+      goto bail_out;
    }
 
    /* 
@@ -239,8 +208,7 @@ int do_backup(JCR *jcr)
    }
    bnet_fsend(fd, storaddr, jcr->store->address, jcr->store->SDDport);
    if (!response(fd, OKstore, "Storage")) {
-      backup_cleanup(jcr, JS_ErrorTerminated, since);
-      return 0;
+      goto bail_out;
    }
 
    /* 
@@ -258,27 +226,34 @@ int do_backup(JCR *jcr)
         break;
       case L_SINCE:
       default:
-         Emsg1(M_FATAL, 0, _("Unimplemented backup level %d\n"), jcr->JobLevel);
-        backup_cleanup(jcr, JS_ErrorTerminated, since);
-        return 0;
+         Jmsg2(jcr, M_FATAL, 0, _("Unimplemented backup level %d %c\n"), 
+           jcr->JobLevel, jcr->JobLevel);
+        goto bail_out;
    }
    Dmsg1(20, ">filed: %s", fd->msg);
    if (!response(fd, OKlevel, "Level")) {
-      backup_cleanup(jcr, JS_ErrorTerminated, since);
-      return 0;
+      goto bail_out;
    }
 
    /* Send backup command */
    bnet_fsend(fd, backupcmd);
    if (!response(fd, OKbackup, "backup")) {
-      backup_cleanup(jcr, JS_ErrorTerminated, since);
-      return 0;
+      goto bail_out;
    }
 
    /* Pickup Job termination data */       
    stat = wait_for_job_termination(jcr);
    backup_cleanup(jcr, stat, since);
    return 1;
+
+bail_out:
+   if (jcr->stime) {
+      free_pool_memory(jcr->stime);
+      jcr->stime = NULL;
+   }
+   backup_cleanup(jcr, JS_ErrorTerminated, since);
+   return 0;
+
 }
 
 /*
@@ -302,21 +277,8 @@ static int wait_for_job_termination(JCR *jcr)
          bnet_strerror(fd));
    }
 
-   /* Now wait for Storage daemon to terminate our message thread */
-   P(jcr->mutex);
-   jcr->JobStatus = JS_WaitSD;
-   while (!jcr->msg_thread_done && !job_cancelled(jcr)) {
-      struct timeval tv;
-      struct timezone tz;
-      struct timespec timeout;
-
-      gettimeofday(&tv, &tz);
-      timeout.tv_nsec = 0;
-      timeout.tv_sec = tv.tv_sec + 10; /* wait 10 seconds */
-      Dmsg0(300, "I'm waiting for message thread termination.\n");
-      pthread_cond_timedwait(&jcr->term_wait, &jcr->mutex, &timeout);
-   }
-   V(jcr->mutex);
+   wait_for_storage_daemon_termination(jcr);
+
    if (n < 0) {                                    
       return JS_ErrorTerminated;
    }
@@ -352,7 +314,6 @@ static void backup_cleanup(JCR *jcr, int TermCode, char *since)
         db_strerror(jcr->db));
    }
 
-      
    msg_type = M_INFO;                /* by default INFO message */
    switch (TermCode) {
       case JS_Terminated:
index d8b8dc3b33962515dda5dabbc05bdac8d625790d..6aae9dbabc26fa51d3a701228eb7dea0a478101c 100644 (file)
@@ -48,12 +48,12 @@ static char Update_media[] = "CatReq Job=%127s UpdateMedia VolName=%s\
  VolJobs=%d VolFiles=%d VolBlocks=%d VolBytes=%" lld " VolMounts=%d\
  VolErrors=%d VolWrites=%d VolMaxBytes=%" lld " EndTime=%d VolStatus=%10s\
  FirstIndex=%d LastIndex=%d StartFile=%d EndFile=%d \
- StartBlock=%d EndBlock=%d relabel=%d\n";
+ StartBlock=%d EndBlock=%d relabel=%d Slot=%d\n";
 
 /* Responses  sent to Storage daemon */
 static char OK_media[] = "1000 OK VolName=%s VolJobs=%d VolFiles=%d\
  VolBlocks=%d VolBytes=%" lld " VolMounts=%d VolErrors=%d VolWrites=%d\
- VolMaxBytes=%" lld " VolCapacityBytes=%" lld " VolStatus=%s\n";
+ VolMaxBytes=%" lld " VolCapacityBytes=%" lld " VolStatus=%s Slot=%d\n";
 
 static char OK_update[] = "1000 OK UpdateMedia\n";
 
@@ -109,7 +109,7 @@ void catalog_request(JCR *jcr, BSOCK *bs, char *msg)
         bnet_fsend(bs, OK_media, mr.VolumeName, mr.VolJobs,
            mr.VolFiles, mr.VolBlocks, mr.VolBytes, mr.VolMounts, mr.VolErrors,
            mr.VolWrites, mr.VolMaxBytes, mr.VolCapacityBytes,
-           mr.VolStatus);
+           mr.VolStatus, mr.Slot);
       } else {
          bnet_fsend(bs, "1999 No Media\n");
       }
@@ -163,7 +163,7 @@ MediaType=%s\n", mr.PoolId, jcr->PoolId, mr.VolStatus, mr.MediaType);
       &mr.VolFiles, &mr.VolBlocks, &mr.VolBytes, &mr.VolMounts, &mr.VolErrors,
       &mr.VolWrites, &mr.VolMaxBytes, &mr.LastWritten, &mr.VolStatus, 
       &jm.FirstIndex, &jm.LastIndex, &jm.StartFile, &jm.EndFile,
-      &jm.StartBlock, &jm.EndBlock, &relabel) == 19) {
+      &jm.StartBlock, &jm.EndBlock, &relabel, &mr.Slot) == 20) {
       /*     
        * Update Media Record
        */
index 8de6fce6c3ba835d9e021acebeb9dcb6eb8d75d6..640b7be170c0619391a45cabf36b1f661fac8b52 100644 (file)
@@ -190,6 +190,9 @@ int main (int argc, char *argv[])
 
    init_console_msg(working_directory);
 
+   set_thread_concurrency(director->MaxConcurrentJobs * 2 +
+      4 /* UA */ + 4 /* sched+watchdog+jobsvr+misc */);
+
    Dmsg0(200, "Start UA server\n");
    start_UA_server(director->DIRport);
 
index 153533132771244832e24f03981268606d7db0e2..1cc6195c4ae98b7c9885f30aef13652e0adb5761 100644 (file)
@@ -234,6 +234,21 @@ static struct res_items pool_items[] = {
    {NULL, NULL, NULL, 0, 0, 0} 
 };
 
+/* 
+ * Counter Resource
+ *   name            handler     value                        code flags default_value
+ */
+static struct res_items counter_items[] = {
+   {"name",            store_name,    ITEM(res_counter.hdr.name),        0, ITEM_REQUIRED, 0},
+   {"description",     store_str,     ITEM(res_counter.hdr.desc),        0, 0,     0},
+   {"minimum",         store_int,     ITEM(res_counter.MinValue),        0, ITEM_DEFAULT, 0},
+   {"maximum",         store_pint,    ITEM(res_counter.MaxValue),        0, ITEM_DEFAULT, INT32_MAX},
+   {"global",          store_yesno,   ITEM(res_counter.Global),          0, ITEM_DEFAULT, 0},
+   {"wrapcounter",     store_strname, ITEM(res_counter.WrapCounter),     0, 0, 0},
+   {NULL, NULL, NULL, 0, 0, 0} 
+};
+
+
 /* Message resource */
 extern struct res_items msgs_items[];
 
@@ -254,6 +269,7 @@ struct s_res resources[] = {
    {"group",         group_items, R_GROUP,     NULL},
    {"pool",          pool_items,  R_POOL,      NULL},
    {"messages",      msgs_items,  R_MSGS,      NULL},
+   {"counter",       counter_items, R_COUNTER, NULL},
    {NULL,           NULL,        0,           NULL}
 };
 
@@ -270,7 +286,7 @@ struct s_jl joblevels[] = {
    {"Since",         L_SINCE,           JT_BACKUP},
    {"Catalog",       L_VERIFY_CATALOG,  JT_VERIFY},
    {"Initcatalog",   L_VERIFY_INIT,     JT_VERIFY},
-   {"Volume",        L_VERIFY_VOLUME,   JT_VERIFY},
+   {"VolumeToCatalog", L_VERIFY_VOLUME_TO_CATALOG,   JT_VERIFY},
    {"Data",          L_VERIFY_DATA,     JT_VERIFY},
    {NULL,           0}
 };
@@ -324,6 +340,8 @@ static struct s_kw ReplaceOptions[] = {
 #define FS_KW_SIGNATURE    2
 #define FS_KW_ENCRYPTION   3
 #define FS_KW_VERIFY      4
+#define FS_KW_ONEFS       5
+#define FS_KW_RECURSE     6
 
 /* FileSet keywords */
 static struct s_kw FS_option_kw[] = {
@@ -331,6 +349,8 @@ static struct s_kw FS_option_kw[] = {
    {"signature",   FS_KW_SIGNATURE},
    {"encryption",  FS_KW_ENCRYPTION},
    {"verify",      FS_KW_VERIFY},
+   {"onefs",       FS_KW_ONEFS},
+   {"recurse",     FS_KW_RECURSE},
    {NULL,         0}
 };
 
@@ -355,8 +375,12 @@ static struct s_fs_opt FS_options[] = {
    {"gzip7",    FS_KW_COMPRESSION,  "Z7"},
    {"gzip8",    FS_KW_COMPRESSION,  "Z8"},
    {"gzip9",    FS_KW_COMPRESSION,  "Z9"},
-   {"blowfish", FS_KW_ENCRYPTION,   "B"},   /* ***FIXME*** not implemented */
-   {"3des",     FS_KW_ENCRYPTION,   "3"},   /* ***FIXME*** not implemented */
+   {"blowfish", FS_KW_ENCRYPTION,    "B"},   /* ***FIXME*** not implemented */
+   {"3des",     FS_KW_ENCRYPTION,    "3"},   /* ***FIXME*** not implemented */
+   {"yes",      FS_KW_ONEFS,         "0"},
+   {"no",       FS_KW_ONEFS,         "f"},
+   {"yes",      FS_KW_RECURSE,       "0"},
+   {"no",       FS_KW_RECURSE,       "h"},
    {NULL,      0,                   0}
 };
 
index 862e7c35793712ac027d53af951f1500079a8c71..603ca943aaccd4075b8f80af0ee9b413028a536a 100644 (file)
@@ -42,8 +42,9 @@
 #define R_GROUP                      1008
 #define R_POOL                       1009
 #define R_MSGS                       1010
+#define R_COUNTER                    1011
 
-#define R_LAST                       R_MSGS
+#define R_LAST                       R_COUNTER
 
 /*
  * Some resource attributes
@@ -210,6 +211,19 @@ struct s_res_group {
 };
 typedef struct s_res_group GROUP;
 
+/*
+ *   Counter Resource
+ */
+struct s_res_counter {
+   RES  hdr;
+
+   int32_t MinValue;                 /* Minimum value */
+   int32_t MaxValue;                 /* Maximum value */
+   int    Global;                    /* global/local */
+   char  *WrapCounter;               /* Wrap counter name */
+};
+typedef struct s_res_counter COUNTER;
+
 /*
  *   Pool Resource   
  *
@@ -217,7 +231,8 @@ typedef struct s_res_group GROUP;
 struct s_res_pool {
    RES  hdr;
 
-   char *pool_type;
+   struct s_res_counter counter;      /* Counter resources */
+   char *pool_type;                  /* Pool type */
    char *label_format;               /* Label format string */
    int  use_catalog;                 /* maintain catalog for media */
    int  catalog_files;               /* maintain file entries in catalog */
@@ -245,6 +260,7 @@ union u_res {
    struct s_res_group  res_group;
    struct s_res_pool   res_pool;
    struct s_res_msgs   res_msgs;
+   struct s_res_counter res_counter;
    RES hdr;
 };
 
index e2ce5d29068b491ff2a97eadc119073ff253e085..0900b33d9613e949522cfc878425908fdeb4025d 100644 (file)
@@ -101,7 +101,6 @@ void run_job(JCR *jcr)
    }
    Dmsg0(50, "DB opened\n");
 
-
    /*
     * Create Job record  
     */
@@ -161,11 +160,15 @@ static void job_thread(void *arg)
            break;
         case JT_VERIFY:
            do_verify(jcr);
-//         do_autoprune(jcr);
+           if (jcr->JobStatus == JS_Terminated) {
+              do_autoprune(jcr);
+           }
            break;
         case JT_RESTORE:
            do_restore(jcr);
-//         do_autoprune(jcr);
+           if (jcr->JobStatus == JS_Terminated) {
+              do_autoprune(jcr);
+           }
            break;
         case JT_ADMIN:
            /* No actual job */
@@ -199,7 +202,7 @@ int get_or_create_client_record(JCR *jcr)
    jcr->client_name = get_memory(strlen(jcr->client->hdr.name) + 1);
    strcpy(jcr->client_name, jcr->client->hdr.name);
    if (!db_create_client_record(jcr->db, &cr)) {
-      Jmsg(jcr, M_ERROR, 0, _("Could not create Client record. %s"), 
+      Jmsg(jcr, M_FATAL, 0, _("Could not create Client record. %s"), 
         db_strerror(jcr->db));
       return 0;
    }
index 444491601f8daebc5cc99456b261921332239fb5..324e0d4389780b99cdb83d57b034b7f1eff81d32 100644 (file)
@@ -172,7 +172,6 @@ int start_storage_daemon_message_thread(JCR *jcr)
    P(jcr->mutex);
    jcr->use_count++;                 /* mark in use by msg thread */
    V(jcr->mutex);
-   set_thread_concurrency(4);
    if ((status=pthread_create(&thid, NULL, msg_thread, (void *)jcr)) != 0) {
       Emsg1(M_ABORT, 0, _("Cannot create message thread: %s\n"), strerror(status));
    }        
@@ -237,3 +236,22 @@ static void *msg_thread(void *arg)
    pthread_cleanup_pop(1);
    return NULL;
 }
+
+void wait_for_storage_daemon_termination(JCR *jcr)
+{
+   /* Now wait for Storage daemon to terminate our message thread */
+   P(jcr->mutex);
+   jcr->JobStatus = JS_WaitSD;
+   while (!jcr->msg_thread_done && !job_cancelled(jcr)) {
+      struct timeval tv;
+      struct timezone tz;
+      struct timespec timeout;
+
+      gettimeofday(&tv, &tz);
+      timeout.tv_nsec = 0;
+      timeout.tv_sec = tv.tv_sec + 10; /* wait 10 seconds */
+      Dmsg0(300, "I'm waiting for message thread termination.\n");
+      pthread_cond_timedwait(&jcr->term_wait, &jcr->mutex, &timeout);
+   }
+   V(jcr->mutex);
+}
index 10788274a419eb70b3f44db1182ee380502a318b..b620ad088b6550f62bc0d9774dea80f0ba4e899b 100644 (file)
@@ -30,11 +30,11 @@ extern int authenticate_user_agent(BSOCK *ua);
 
 /* autoprune.c */
 extern int do_autoprune(JCR *jcr);
-int prune_volumes(JCR *jcr);
+extern int prune_volumes(JCR *jcr);
 
 /* autorecycle.c */
-int recycle_a_volume(JCR *jcr, MEDIA_DBR *mr);
-int find_recycled_volume(JCR *jcr, MEDIA_DBR *mr);
+extern int recycle_a_volume(JCR *jcr, MEDIA_DBR *mr);
+extern int find_recycled_volume(JCR *jcr, MEDIA_DBR *mr);
 
 
 /* catreq.c */
@@ -50,7 +50,7 @@ extern int connect_to_file_daemon(JCR *jcr, int retry_interval,
 extern int send_include_list(JCR *jcr);
 extern int send_exclude_list(JCR *jcr);
 extern int get_attributes_and_put_in_catalog(JCR *jcr);
-extern int get_attributes_and_compare_to_catalog(JCR *jcr, int last_full_id);
+extern int get_attributes_and_compare_to_catalog(JCR *jcr, JobId_t JobId);
 extern int put_file_into_catalog(JCR *jcr, long file_index, char *fname, 
                          char *link, char *attr, int stream);
 
@@ -71,6 +71,7 @@ extern int start_storage_daemon_job(JCR *jcr);
 extern int start_storage_daemon_message_thread(JCR *jcr);
 extern int32_t bget_msg(BSOCK *bs, int type);
 extern int response(BSOCK *fd, char *resp, char *cmd);
+extern void wait_for_storage_daemon_termination(JCR *jcr);
 
 /* newvol.c */
 extern int newVolume(JCR *jcr, MEDIA_DBR *mr);
index 13c092dbf9cb6e009044b5969aa5bd5a8a515876..8abee797a89443dc17c24d5ae8e5a7901e4e74ae 100644 (file)
@@ -91,5 +91,5 @@ int confirm_retention(UAContext *ua, btime_t *ret, char *msg);
 
 /* ua_prune.c */
 int prune_files(UAContext *ua, CLIENT *client);
-int prune_jobs(UAContext *ua, CLIENT *client);
+int prune_jobs(UAContext *ua, CLIENT *client, int JobType);
 int prune_volume(UAContext *ua, POOL_DBR *pr, MEDIA_DBR *mr);
index b2ed0c0f63ef37de1bff8cc0a3f294d6b98082a1..6b4e399eaf5e328cc60d6ba18d61670cfb0c1247 100644 (file)
@@ -91,7 +91,7 @@ static struct cmdstruct commands[] = {
  { N_("sqlquery"),   sqlquerycmd,  _("use SQL to query catalog")}, 
  { N_("status"),     statuscmd,    _("status [storage | client]=<name>")},
  { N_("unmount"),    unmountcmd,   _("unmount <storage-name>")},
- { N_("update"),     updatecmd,    _("update DB Pool from resource")},
+ { N_("update"),     updatecmd,    _("update Volume or Pool")},
  { N_("use"),        usecmd,       _("use catalog xxx")},
  { N_("version"),    versioncmd,   _("print Director version")},
  { N_("quit"),       quitcmd,      _("quit")},
@@ -500,6 +500,7 @@ Use update to change it.\n"), pool->hdr.name);
    default:
      break;
    }
+   bsendmsg(ua, _("Pool %s created.\n"), pool->hdr.name);
    return 1;
 }
 
@@ -540,8 +541,8 @@ static int updatecmd(UAContext *ua, char *cmd)
    }
     
    start_prompt(ua, _("Update choice:\n"));
-   add_prompt(ua, _("pool"));
-   add_prompt(ua, _("volume"));
+   add_prompt(ua, _("Pool from resource"));
+   add_prompt(ua, _("Volume parameters"));
    switch (do_prompt(ua, _("Choose catalog item to update"), NULL)) {
       case 0:
         update_pool(ua);
@@ -600,12 +601,12 @@ static int update_volume(UAContext *ua)
    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, _("Recycle"));
+      add_prompt(ua, _("Volume Retention Period"));
+      add_prompt(ua, _("Recycle Flag"));
       add_prompt(ua, _("Done"));
       switch (do_prompt(ua, _("Select paramter to modify"), NULL)) {
       case 0:                        /* Volume Status */
-        /* Modify Volume */
+        /* Modify Volume Status */
          bsendmsg(ua, _("Current value is: %s\n"), mr.VolStatus);
          start_prompt(ua, _("Possible Values are:\n"));
          add_prompt(ua, "Append");
@@ -714,8 +715,10 @@ static int update_pool(UAContext *ua)
    }
    id = db_update_pool_record(ua->db, &pr);
    if (id <= 0) {
-      bsendmsg(ua, "Error: db_update_pool_record returned %d\n", id);
+      bsendmsg(ua, _("db_update_pool_record returned %d. ERR=%s\n"),
+        id, db_strerror(ua->db));
    }
+   bsendmsg(ua, _("Pool DB record updated from resource.\n"));
    return 1;
 }
 
index 5034b4ffe7120df9496ec41eb9205a4dd27cc295..82a6583d792eb626fab91783c08da3cfee0d74f3 100644 (file)
@@ -34,7 +34,7 @@
 
 /* Forward referenced functions */
 int prune_files(UAContext *ua, CLIENT *client);
-int prune_jobs(UAContext *ua, CLIENT *client);
+int prune_jobs(UAContext *ua, CLIENT *client, int JobType);
 int prune_volume(UAContext *ua, POOL_DBR *pr, MEDIA_DBR *mr);
 static int mark_media_purged(UAContext *ua, MEDIA_DBR *mr);
 
@@ -72,7 +72,8 @@ static char *create_deltabs[] = {
 
 
 /*
- * Fill candidates table with all Files subject to being deleted
+ * Fill candidates table with all Files subject to being deleted.
+ *  This is used for pruning Jobs (first the files, then the Jobs).
  */
 static char *insert_delcand = 
    "INSERT INTO DelCandidates "
@@ -83,17 +84,44 @@ static char *insert_delcand =
 /*
  * Select files from the DelCandidates table that have a
  * more recent backup -- i.e. are not the only backup.
- * This is the list of files to delete.
+ * This is the list of files to delete for a Backup Job.
  */
-static char *select_del =
+static char *select_backup_del =
    "SELECT DelCandidates.JobId "
    "FROM Job,DelCandidates "
    "WHERE Job.JobTDate >= %s "
    "AND Job.ClientId=%d "
+   "AND Job.JobType='B' "
    "AND Job.Level='F' "
    "AND Job.JobStatus='T' "
    "AND Job.FileSetId=DelCandidates.FileSetId";
 
+/*
+ * Select files from the DelCandidates table that have a
+ * more recent InitCatalog -- i.e. are not the only InitCatalog
+ * This is the list of files to delete for a Verify Job.
+ */
+static char *select_verify_del =
+   "SELECT DelCandidates.JobId "
+   "FROM Job,DelCandidates "
+   "WHERE Job.JobTDate >= %s "
+   "AND Job.ClientId=%d "
+   "AND Job.JobType='V' "
+   "AND Job.Level='V' "
+   "AND Job.JobStatus='T' "
+   "AND Job.FileSetId=DelCandidates.FileSetId";
+
+/*
+ * Select files from the DelCandidates table.
+ * This is the list of files to delete for a Restore Job.
+ */
+static char *select_restore_del =
+   "SELECT DelCandidates.JobId "
+   "FROM Job,DelCandidates "
+   "WHERE Job.JobTDate >= %s "
+   "AND Job.ClientId=%d "   
+   "AND Job.JobType='R'";
+
 /* In memory list of JobIds */
 struct s_file_del_ctx {
    JobId_t *JobId;
@@ -219,7 +247,8 @@ int prunecmd(UAContext *ua, char *cmd)
       if (!client || !confirm_retention(ua, &client->JobRetention, "Job")) {
         return 0;
       }
-      prune_jobs(ua, client);
+      /* ****FIXME**** allow user to select JobType */
+      prune_jobs(ua, client, JT_BACKUP);
       return 1;
    case 2:
       if (!select_pool_and_media_dbr(ua, &pr, &mr)) {
@@ -246,7 +275,8 @@ int prunecmd(UAContext *ua, char *cmd)
       if (!client || !confirm_retention(ua, &client->JobRetention, "Job")) {
         return 0;
       }
-      prune_jobs(ua, client);
+      /* ****FIXME**** allow user to select JobType */
+      prune_jobs(ua, client, JT_BACKUP);
       break;
    case 2:
       if (!select_pool_and_media_dbr(ua, &pr, &mr)) {
@@ -293,10 +323,9 @@ int prune_files(UAContext *ua, CLIENT *client)
    period = client->FileRetention;
    now = (btime_t)time(NULL);
        
+   /* Select Jobs -- for counting */
    Mmsg(&query, select_job, edit_uint64(now - period, ed1), cr.ClientId);
-
    Dmsg1(050, "select sql=%s\n", query);
    if (!db_sql_query(ua->db, query, file_count_handler, (void *)&del)) {
       if (ua->verbose) {
          bsendmsg(ua, "%s", db_strerror(ua->db));
@@ -322,6 +351,7 @@ int prune_files(UAContext *ua, CLIENT *client)
 
    del.JobId = (JobId_t *)malloc(sizeof(JobId_t) * del.max_ids);
 
+   /* Now process same set but making delete list */
    db_sql_query(ua->db, query, file_delete_handler, (void *)&del);
 
    for (i=0; i < del.num_ids; i++) {
@@ -389,8 +419,12 @@ static int create_temp_tables(UAContext *ua)
  * In other words, we never delete the only Job record that
  * contains a current backup of a FileSet. This prevents the
  * Volume from being recycled and destroying a current backup.
+ *
+ * For Verify Jobs, we do not delete the last InitCatalog.
+ *
+ * For Restore Jobs there are no restrictions.
  */
-int prune_jobs(UAContext *ua, CLIENT *client)
+int prune_jobs(UAContext *ua, CLIENT *client, int JobType)
 {
    struct s_job_del_ctx del;
    struct s_count_ctx cnt;
@@ -426,7 +460,6 @@ int prune_jobs(UAContext *ua, CLIENT *client)
     */
    edit_uint64(now - period, ed1);
    Mmsg(&query, insert_delcand, ed1, cr.ClientId);
-
    if (!db_sql_query(ua->db, query, NULL, (void *)NULL)) {
       if (ua->verbose) {
          bsendmsg(ua, "%s", db_strerror(ua->db));
@@ -435,10 +468,9 @@ int prune_jobs(UAContext *ua, CLIENT *client)
       goto bail_out;
    }
 
+   /* Count Files to be deleted */
    strcpy(query, "SELECT count(*) FROM DelCandidates");
-   
    Dmsg1(100, "select sql=%s\n", query);
    if (!db_sql_query(ua->db, query, count_handler, (void *)&cnt)) {
       if (ua->verbose) {
          bsendmsg(ua, "%s", db_strerror(ua->db));
@@ -463,7 +495,18 @@ int prune_jobs(UAContext *ua, CLIENT *client)
    del.JobId = (JobId_t *)malloc(sizeof(JobId_t) * del.max_ids);
    del.PurgedFiles = (char *)malloc(del.max_ids);
 
-   Mmsg(&query, select_del, ed1, cr.ClientId);
+   switch (JobType) {
+   case JT_ADMIN:
+   case JT_BACKUP:
+      Mmsg(&query, select_backup_del, ed1, cr.ClientId);
+      break;
+   case JT_RESTORE:
+      Mmsg(&query, select_restore_del, ed1, cr.ClientId);
+      break;
+   case JT_VERIFY:
+      Mmsg(&query, select_verify_del, ed1, cr.ClientId);
+      break;
+   }
    db_sql_query(ua->db, query, job_delete_handler, (void *)&del);
 
    /* 
index be8dfc46598cfda492eb749d1c1a6eb1318b6f84..01864faafcccfbd8be7741e570166aadd92f3a22 100644 (file)
@@ -219,7 +219,6 @@ try_again:
       case JT_VERIFY:
         if (level_name) {
            /* Look up level name and pull code */
-           lcase(level_name);
            found = 0;
            for (i=0; joblevels[i].level_name; i++) {
               if (strcasecmp(level_name, _(joblevels[i].level_name)) == 0) {
@@ -283,21 +282,24 @@ JobId:      %s\n"),
       default:
          bsendmsg(ua, _("Unknown Job Type=%d\n"), jcr->JobType);
         free_jcr(jcr);
-        return 1;
+        return 0;
    }
    if (!get_cmd(ua, _("OK to run? (yes/mod/no): "))) {
       free_jcr(jcr);
-      return 1;
+      return 0;                      /* do not run */
    }
+   /*
+    * At user request modify parameters of job to be run.
+    */
    if (strcasecmp(ua->cmd, _("mod")) == 0) {
       FILE *fd;
 
       start_prompt(ua, _("Parameters to modify:\n"));
-      add_prompt(ua, _("Job"));              /* 0 */
-      add_prompt(ua, _("Level"));            /* 1 */
-      add_prompt(ua, _("FileSet"));          /* 2 */
-      add_prompt(ua, _("Client"));           /* 3 */
-      add_prompt(ua, _("Storage"));          /* 4 */
+      add_prompt(ua, _("Level"));            /* 0 */
+      add_prompt(ua, _("Storage"));          /* 1 */
+      add_prompt(ua, _("Job"));              /* 2 */
+      add_prompt(ua, _("FileSet"));          /* 3 */
+      add_prompt(ua, _("Client"));           /* 4 */
       if (jcr->JobType == JT_RESTORE) {
          add_prompt(ua, _("Bootstrap"));     /* 5 */
          add_prompt(ua, _("Where"));         /* 6 */
@@ -305,15 +307,6 @@ JobId:      %s\n"),
       }
       switch (do_prompt(ua, _("Select parameter to modify"), NULL)) {
       case 0:
-        /* Job */
-        job = select_job_resource(ua);
-        if (job) {
-           jcr->job = job;
-           set_jcr_defaults(jcr, job);
-           goto try_again;
-        }
-        break;
-      case 1:
         /* Level */
         if (jcr->JobType == JT_BACKUP) {
             start_prompt(ua, _("Levels:\n"));
@@ -345,7 +338,7 @@ JobId:      %s\n"),
         } else if (jcr->JobType == JT_VERIFY) {
             start_prompt(ua, _("Levels:\n"));
             add_prompt(ua, _("Initialize Catalog"));
-            add_prompt(ua, _("Verify from Catalog"));
+            add_prompt(ua, _("Verify Catalog"));
             add_prompt(ua, _("Verify Volume"));
             add_prompt(ua, _("Verify Volume Data"));
             switch (do_prompt(ua, _("Select level"), NULL)) {
@@ -356,7 +349,7 @@ JobId:      %s\n"),
               jcr->JobLevel = L_VERIFY_CATALOG;
               break;
            case 2:
-              jcr->JobLevel = L_VERIFY_VOLUME;
+              jcr->JobLevel = L_VERIFY_VOLUME_TO_CATALOG;
               break;
            case 3:
               jcr->JobLevel = L_VERIFY_DATA;
@@ -367,7 +360,23 @@ JobId:      %s\n"),
            goto try_again;
         }
         goto try_again;
+      case 1:
+        store = select_storage_resource(ua);
+        if (store) {
+           jcr->store = store;
+           goto try_again;
+        }
+        break;
       case 2:
+        /* Job */
+        job = select_job_resource(ua);
+        if (job) {
+           jcr->job = job;
+           set_jcr_defaults(jcr, job);
+           goto try_again;
+        }
+        break;
+      case 3:
         /* FileSet */
         fileset = select_fs_resource(ua);
         if (fileset) {
@@ -375,20 +384,13 @@ JobId:      %s\n"),
            goto try_again;
         }      
         break;
-      case 3:
+      case 4:
         client = select_client_resource(ua);
         if (client) {
            jcr->client = client;
            goto try_again;
         }
         break;
-      case 4:
-        store = select_storage_resource(ua);
-        if (store) {
-           jcr->store = store;
-           goto try_again;
-        }
-        break;
       case 5:
         /* Bootstrap */
          if (!get_cmd(ua, _("Please enter the Bootstrap file name: "))) {
@@ -439,12 +441,12 @@ JobId:      %s\n"),
       }
       bsendmsg(ua, _("Job not run.\n"));
       free_jcr(jcr);
-      return 1;
+      return 0;                      /* error do no run Job */
    }
    if (strcasecmp(ua->cmd, _("yes")) != 0) {
       bsendmsg(ua, _("Job not run.\n"));
       free_jcr(jcr);
-      return 1;
+      return 0;                      /* do not run */
    }
 
    Dmsg1(200, "Calling run_job job=%x\n", jcr->job);
index 0628df3df4b77363a191ac66d2ca3c66dc81b1e1..5e67d27923a5d99573ba2ce211d932be038f4f7e 100644 (file)
@@ -67,7 +67,6 @@ void start_UA_server(int UA_port)
    pthread_t thid;
    int status;
 
-   set_thread_concurrency(4);
    if ((status=pthread_create(&thid, NULL, connect_thread, (void *)UA_port)) != 0) {
       Emsg1(M_ABORT, 0, _("Cannot create UA thread: %s\n"), strerror(status));
    }
index 475c9800048c7f70b453da437fcfcae4db2c41cb..2b5195bed772434b3eb0096273955e65d96f9aa8 100644 (file)
 extern int debug_level;
 
 /* Commands sent to File daemon */
-static char verifycmd[]   = "verify level=%s\n";
+static char verifycmd[]    = "verify level=%s\n";
+static char storaddr[]     = "storage address=%s port=%d\n";
+static char sessioncmd[]   = "session %s %ld %ld %ld %ld %ld %ld\n";  
 
 /* Responses received from File daemon */
-static char OKverify[]   = "2000 OK verify\n";
+static char OKverify[]    = "2000 OK verify\n";
+static char OKstore[]     = "2000 OK storage\n";
+static char OKsession[]   = "2000 OK session\n";
 
 /* Forward referenced functions */
 static void verify_cleanup(JCR *jcr, int TermCode);
@@ -58,7 +62,7 @@ static void prt_fname(JCR *jcr);
 static int missing_handler(void *ctx, int num_fields, char **row);
 
 /* 
- * Do a verification of the specified files
+ * Do a verification of the specified files against the Catlaog
  *    
  *  Returns:  0 on failure
  *           1 on success
@@ -68,7 +72,7 @@ int do_verify(JCR *jcr)
    char *level;
    BSOCK   *fd;
    JOB_DBR jr;
-   int last_full_id;
+   JobId_t JobId;
 
    if (!get_or_create_client_record(jcr)) {
       goto bail_out;
@@ -80,22 +84,22 @@ int do_verify(JCR *jcr)
     * we must look up the time and date of the
     * last full verify.
     */
-   if (jcr->JobLevel == L_VERIFY_CATALOG) {
+   if (jcr->JobLevel == L_VERIFY_CATALOG || jcr->JobLevel == L_VERIFY_VOLUME_TO_CATALOG) {
       memcpy(&jr, &(jcr->jr), sizeof(jr));
-      if (!db_find_last_full_verify(jcr->db, &jr)) {
+      if (!db_find_last_jobid(jcr->db, &jr)) {
          Jmsg(jcr, M_FATAL, 0, _("Unable to find last full verify. %s"),
            db_strerror(jcr->db));
         goto bail_out;
       }
-      last_full_id = jr.JobId;
-      Dmsg1(20, "Last full id=%d\n", last_full_id);
-   }
+      JobId = jr.JobId;
+      Dmsg1(20, "Last full id=%d\n", JobId);
+   } 
 
    jcr->jr.JobId = jcr->JobId;
    jcr->jr.StartTime = jcr->start_time;
    jcr->jr.Level = jcr->JobLevel;
    if (!db_update_job_start_record(jcr->db, &jcr->jr)) {
-      Jmsg(jcr, M_ERROR, 0, "%s", db_strerror(jcr->db));
+      Jmsg(jcr, M_FATAL, 0, "%s", db_strerror(jcr->db));
       goto bail_out;
    }
 
@@ -103,32 +107,79 @@ int do_verify(JCR *jcr)
       jcr->fname = (char *) get_pool_memory(PM_FNAME);
    }
 
-   jcr->jr.JobId = last_full_id;      /* save last full id */
+   jcr->jr.JobId = JobId;      /* save target JobId */
 
    /* Print Job Start message */
    Jmsg(jcr, M_INFO, 0, _("Start Verify JobId %d Job=%s\n"),
       jcr->JobId, jcr->Job);
 
-   if (jcr->JobLevel == L_VERIFY_CATALOG) {
+   if (jcr->JobLevel == L_VERIFY_CATALOG || jcr->JobLevel == L_VERIFY_VOLUME_TO_CATALOG) {
       memset(&jr, 0, sizeof(jr));
-      jr.JobId = last_full_id;
+      jr.JobId = JobId;
       if (!db_get_job_record(jcr->db, &jr)) {
-         Jmsg(jcr, M_ERROR, 0, _("Could not get job record. %s"), db_strerror(jcr->db));
+         Jmsg(jcr, M_FATAL, 0, _("Could not get job record. %s"), db_strerror(jcr->db));
         goto bail_out;
       }
-      Jmsg(jcr, M_INFO, 0, _("Verifying against Init JobId %d run %s\n"),
-        last_full_id, jr.cStartTime); 
+      if (jr.JobStatus != 'T') {
+         Jmsg(jcr, M_FATAL, 0, _("Last Job %d did not terminate normally. JobStatus=%c\n"),
+           JobId, jr.JobStatus);
+        goto bail_out;
+      }
+      Jmsg(jcr, M_INFO, 0, _("Verifying against JobId=%d Job=%s\n"),
+        JobId, jr.Job); 
    }
 
+   /* 
+    * If we are verifing a Volume, we need the Storage
+    *  daemon, so open a connection, otherwise, just
+    *  create a dummy authorization key (passed to
+    *  File daemon but not used).
+    */
+   if (jcr->JobLevel == L_VERIFY_VOLUME_TO_CATALOG) {
+      /*
+       * Now find the Volumes we will need for the Verify 
+       */
+      jcr->VolumeName[0] = 0;
+      if (!db_get_job_volume_names(jcr->db, jr.JobId, jcr->VolumeName) ||
+          jcr->VolumeName[0] == 0) {
+         Jmsg(jcr, M_FATAL, 0, _("Cannot find Volume Name for verify JobId=%d. %s"), 
+           jr.JobId, db_strerror(jcr->db));
+        goto bail_out;
+      }
+      Dmsg1(20, "Got job Volume Names: %s\n", jcr->VolumeName);
+      /*
+       * Start conversation with Storage daemon  
+       */
+      jcr->JobStatus = JS_Blocked;
+      if (!connect_to_storage_daemon(jcr, 10, SDConnectTimeout, 1)) {
+        goto bail_out;
+      }
+      /*
+       * Now start a job with the Storage daemon
+       */
+      if (!start_storage_daemon_job(jcr)) {
+        goto bail_out;
+      }
+      /*
+       * Now start a Storage daemon message thread
+       */
+      if (!start_storage_daemon_message_thread(jcr)) {
+        goto bail_out;
+      }
+      Dmsg0(50, "Storage daemon connection OK\n");
+   } else {
+      jcr->sd_auth_key = bstrdup("dummy");    /* dummy Storage daemon key */
+   }
    /*
     * OK, now connect to the File daemon
     *  and ask him for the files.
     */
-   jcr->sd_auth_key = bstrdup("dummy");    /* dummy Storage daemon key */
+   jcr->JobStatus = JS_Blocked;
    if (!connect_to_file_daemon(jcr, 10, FDConnectTimeout, 1)) {
       goto bail_out;
    }
 
+   jcr->JobStatus = JS_Running;
    fd = jcr->file_bsock;
 
    Dmsg0(30, ">filed: Send include list\n");
@@ -142,8 +193,8 @@ int do_verify(JCR *jcr)
    }
 
    /* 
-    * Send Level command to File daemon
-    *
+    * Send Level command to File daemon, as well
+    *  as the Storage address if appropriate.
     */
    switch (jcr->JobLevel) {
       case L_VERIFY_INIT:
@@ -152,7 +203,29 @@ int do_verify(JCR *jcr)
       case L_VERIFY_CATALOG:
          level = "catalog";
         break;
-      case L_VERIFY_VOLUME:
+      case L_VERIFY_VOLUME_TO_CATALOG:
+        /* 
+         * send Storage daemon address to the File daemon
+         */
+        if (jcr->store->SDDport == 0) {
+           jcr->store->SDDport = jcr->store->SDport;
+        }
+        bnet_fsend(fd, storaddr, jcr->store->address, jcr->store->SDDport);
+         if (!response(fd, OKstore, "Storage")) {
+           goto bail_out;
+        }
+        /*
+         * Pass the VolSessionId, VolSessionTime, Start and
+         * end File and Blocks on the session command.
+         */
+        bnet_fsend(fd, sessioncmd, 
+                  jcr->VolumeName,
+                  jr.VolSessionId, jr.VolSessionTime, 
+                  jr.StartFile, jr.EndFile, jr.StartBlock, 
+                  jr.EndBlock);
+         if (!response(fd, OKsession, "Session")) {
+           goto bail_out;
+        }
          level = "volume";
         break;
       case L_VERIFY_DATA:
@@ -180,7 +253,22 @@ int do_verify(JCR *jcr)
    switch (jcr->JobLevel) { 
    case L_VERIFY_CATALOG:
       Dmsg0(10, "Verify level=catalog\n");
-      get_attributes_and_compare_to_catalog(jcr, last_full_id);
+      get_attributes_and_compare_to_catalog(jcr, JobId);
+      break;
+
+   case L_VERIFY_VOLUME_TO_CATALOG:
+      int stat;
+      Dmsg0(10, "Verify level=volume\n");
+      get_attributes_and_compare_to_catalog(jcr, JobId);
+      stat = jcr->JobStatus;
+      jcr->JobStatus = JS_WaitSD;
+      wait_for_storage_daemon_termination(jcr);
+      /* If we terminate normally, use SD term code, else, use ours */
+      if (stat == JS_Terminated) {
+        jcr->JobStatus = jcr->SDJobStatus;
+      } else {
+        jcr->JobStatus = stat;
+      }
       break;
 
    case L_VERIFY_INIT:
@@ -213,11 +301,11 @@ static void verify_cleanup(JCR *jcr, int TermCode)
    char term_code[100];
    char *term_msg;
    int msg_type;
-   int last_full_id;
+   JobId_t JobId;
 
    Dmsg0(100, "Enter verify_cleanup()\n");
 
-   last_full_id = jcr->jr.JobId;
+   JobId = jcr->jr.JobId;
    jcr->JobStatus = TermCode;
 
    update_job_end_record(jcr);
@@ -276,7 +364,7 @@ Termination:            %s\n\n"),
 /*
  * This routine is called only during a Verify
  */
-int get_attributes_and_compare_to_catalog(JCR *jcr, int last_full_id)
+int get_attributes_and_compare_to_catalog(JCR *jcr, JobId_t JobId)
 {
    BSOCK   *fd;
    int n, len;
@@ -290,13 +378,20 @@ int get_attributes_and_compare_to_catalog(JCR *jcr, int last_full_id)
 
    memset(&fdbr, 0, sizeof(FILE_DBR));
    fd = jcr->file_bsock;
-   fdbr.JobId = last_full_id;
+   fdbr.JobId = JobId;
    
    Dmsg0(20, "bdird: waiting to receive file attributes\n");
    /*
     * Get Attributes and MD5 Signature from File daemon
+    * We expect:
+    *  FileIndex
+    *  Stream
+    *  Options or MD5
+    *  Filename
+    *  Attributes
+    *  Link name  ???
     */
-   while ((n=bget_msg(fd, 0)) > 0) {
+   while ((n=bget_msg(fd, 0)) > 0 && !job_cancelled(jcr)) {
       long file_index, attr_file_index;
       int stream;
       char *attr, *p, *fn;
@@ -304,7 +399,7 @@ int get_attributes_and_compare_to_catalog(JCR *jcr, int last_full_id)
 
       fname = check_pool_memory_size(fname, fd->msglen);
       jcr->fname = check_pool_memory_size(jcr->fname, fd->msglen);
-      Dmsg1(50, "Atts+MD5=%s\n", fd->msg);
+      Dmsg1(400, "Atts+MD5=%s\n", fd->msg);
       if ((len = sscanf(fd->msg, "%ld %d %100s", &file_index, &stream, 
            Opts_MD5)) != 3) {
          Jmsg3(jcr, M_FATAL, 0, _("bird<filed: bad attributes, expected 3 fields got %d\n\
@@ -328,16 +423,16 @@ int get_attributes_and_compare_to_catalog(JCR *jcr, int last_full_id)
        * Got attributes stream, decode it
        */
       if (stream == STREAM_UNIX_ATTRIBUTES) {
+         Dmsg2(400, "file_index=%d attr=%s\n", file_index, attr);
         jcr->JobFiles++;
         attr_file_index = file_index;    /* remember attribute file_index */
         decode_stat(attr, &statf);  /* decode file stat packet */
         do_MD5 = FALSE;
         jcr->fn_printed = FALSE;
-        strip_trailing_junk(fname);
         strcpy(jcr->fname, fname);  /* move filename into JCR */
 
          Dmsg2(040, "dird<filed: stream=%d %s\n", stream, jcr->fname);
-         Dmsg1(20, "dird<filed: attr=%s\n", attr);
+         Dmsg1(020, "dird<filed: attr=%s\n", attr);
 
         /* 
          * Find equivalent record in the database 
@@ -351,12 +446,12 @@ int get_attributes_and_compare_to_catalog(JCR *jcr, int last_full_id)
         } else {
            /* 
             * mark file record as visited by stuffing the
-            * current JobId, which is unique, into the FileIndex
+            * current JobId, which is unique, into the MarkId field.
             */
            db_mark_file_record(jcr->db, fdbr.FileId, jcr->JobId);
         }
 
-         Dmsg3(100, "Found %s in catalog. inx=%d Opts=%s\n", jcr->fname, 
+         Dmsg3(400, "Found %s in catalog. inx=%d Opts=%s\n", jcr->fname, 
            file_index, Opts_MD5);
         decode_stat(fdbr.LStat, &statc); /* decode catalog stat */
         /*
@@ -457,7 +552,7 @@ int get_attributes_and_compare_to_catalog(JCR *jcr, int last_full_id)
        *  It came across in the Opts_MD5 field.
        */
       } else if (stream == STREAM_MD5_SIGNATURE) {
-         Dmsg2(100, "stream=MD5 inx=%d fname=%s\n", file_index, jcr->fname);
+         Dmsg2(400, "stream=MD5 inx=%d MD5=%s\n", file_index, Opts_MD5);
         /* 
          * When ever we get an MD5 signature is MUST have been
          * preceded by an attributes record, which sets attr_file_index
@@ -496,9 +591,9 @@ int get_attributes_and_compare_to_catalog(JCR *jcr, int last_full_id)
    sprintf(buf, 
 "SELECT Path.Path,Filename.Name FROM File,Path,Filename "
 "WHERE File.JobId=%d "
-"AND File.FileIndex!=%d AND File.PathId=Path.PathId "
+"AND File.MarkedId!=%d AND File.PathId=Path.PathId "
 "AND File.FilenameId=Filename.FilenameId", 
-      last_full_id, jcr->JobId);
+      JobId, jcr->JobId);
    /* missing_handler is called for each file found */
    db_sql_query(jcr->db, buf, missing_handler, (void *)jcr);
    if (jcr->fn_printed) {
index c6f0eea85a1875cce7c91ccaf1fe21a167bcac23..1d69b4db81caa74a718fb8aaad667cd96dc8b56c 100755 (executable)
@@ -19,10 +19,10 @@ dummy:
 #
 SVRSRCS = filed.c authenticate.c backup.c estimate.c \
          filed_conf.c job.c \
-         restore.c status.c verify.c
+         restore.c status.c verify.c verify_vol.c
 SVROBJS = filed.o authenticate.o backup.o estimate.o \
          filed_conf.o job.o \
-         restore.o status.o verify.o
+         restore.o status.o verify.o verify_vol.o
 
 # these are the objects that are changed by the .configure process
 EXTRAOBJS = @OBJLIST@
index 85002d9a7955ab0cca34785e59e435bd1e0b4fe5..bca73ad34c505d2ffdf525307efc34fcd51eb247 100644 (file)
@@ -102,6 +102,10 @@ static int save_file(FF_PKT *ff_pkt, void *ijcr)
    JCR *jcr = (JCR *)ijcr;
    POOLMEM *msgsave;
 
+   if (job_cancelled(jcr)) {
+      return 0;
+   }
+
    sd = jcr->store_bsock;
    dir = jcr->dir_bsock;
    jcr->num_files_examined++;        /* bump total file count */
index bbd95ba5c8938ca6277c26df09ad7caf890bbfc7..70b2e938e593c3377391d2e8e7b550373a2c05e8 100644 (file)
@@ -193,6 +193,8 @@ Without that I don't know who I am :-(\n"), configfile);
    me += 1000000;
 #endif
 
+   set_thread_concurrency(10);
+
    start_watchdog();                 /* start watchdog thread */
 
    /* Become server, and handle requests */
index c0c704fad510b628ff89cccda50a61dab2345c1b..7e1fd7e01438fb26fcd34f139f2159b0fc18863a 100644 (file)
@@ -275,7 +275,7 @@ static int job_cmd(JCR *jcr)
              &jcr->VolSessionId, &jcr->VolSessionTime,
              sd_auth_key) != 5) {
       bnet_fsend(dir, BADjob);
-      Emsg1(M_FATAL, 0, _("Bad Job Command: %s\n"), dir->msg);
+      Jmsg(jcr, M_FATAL, 0, _("Bad Job Command: %s\n"), dir->msg);
       free_pool_memory(sd_auth_key);
       return 0;
    }
@@ -423,11 +423,12 @@ static int session_cmd(JCR *jcr)
 {
    BSOCK *dir = jcr->dir_bsock;
 
+   Dmsg1(050, "SessionCmd: %s", dir->msg);
    if (sscanf(dir->msg, sessioncmd, jcr->VolumeName,
              &jcr->VolSessionId, &jcr->VolSessionTime,
              &jcr->StartFile, &jcr->EndFile, 
              &jcr->StartBlock, &jcr->EndBlock) != 7) {
-      Emsg1(M_FATAL, 0, "Bad session command: %s", dir->msg);
+      Jmsg(jcr, M_FATAL, 0, "Bad session command: %s", dir->msg);
       return 0;
    }
 
@@ -444,8 +445,9 @@ static int storage_cmd(JCR *jcr)
    BSOCK *dir = jcr->dir_bsock;
    BSOCK *sd;                        /* storage daemon bsock */
 
+   Dmsg1(050, "StorageCmd: %s", dir->msg);
    if (sscanf(dir->msg, storaddr, &jcr->stored_addr, &stored_port) != 2) {
-      Emsg1(M_FATAL, 0, _("Bad storage command: %s\n"), dir->msg);
+      Jmsg(jcr, M_FATAL, 0, _("Bad storage command: %s"), dir->msg);
       return 0;
    }
    Dmsg2(30, "Got storage: %s:%d\n", jcr->stored_addr, stored_port);
@@ -454,7 +456,7 @@ static int storage_cmd(JCR *jcr)
    sd = bnet_connect(jcr, 10, 3600, _("Storage daemon"), 
                     jcr->stored_addr, NULL, stored_port, 1);
    if (sd == NULL) {
-      Jmsg2(jcr, M_FATAL, 0, _("Failed to connect to Storage daemon: %s:%d\n"),
+      Jmsg(jcr, M_FATAL, 0, _("Failed to connect to Storage daemon: %s:%d\n"),
          jcr->stored_addr, stored_port);
       return 0;
    }
@@ -487,7 +489,7 @@ static int backup_cmd(JCR *jcr)
    Dmsg1(100, "begin backup ff=%p\n", jcr->ff);
 
    if (sd == NULL) {
-      Emsg0(M_FATAL, 0, _("Cannot contact Storage daemon\n"));
+      Jmsg(jcr, M_FATAL, 0, _("Cannot contact Storage daemon\n"));
       jcr->JobStatus = JS_ErrorTerminated;
       goto cleanup;
    }
@@ -506,13 +508,13 @@ static int backup_cmd(JCR *jcr)
    if (bnet_recv(sd) > 0) {
       Dmsg1(10, "<stored: %s", sd->msg);
       if (sscanf(sd->msg, OK_open, &jcr->Ticket) != 1) {
-         Emsg1(M_FATAL, 0, _("Bad response to append open: %s\n"), sd->msg);
+         Jmsg(jcr, M_FATAL, 0, _("Bad response to append open: %s\n"), sd->msg);
         jcr->JobStatus = JS_ErrorTerminated;
         goto cleanup;
       }
       Dmsg1(10, "Got Ticket=%d\n", jcr->Ticket);
    } else {
-      Emsg0(M_FATAL, 0, _("Bad response from stored to open command\n"));
+      Jmsg(jcr, M_FATAL, 0, _("Bad response from stored to open command\n"));
       jcr->JobStatus = JS_ErrorTerminated;
       goto cleanup;
    }
@@ -566,7 +568,7 @@ static int backup_cmd(JCR *jcr)
          /* discard anything else returned from SD */
       }
       if (len < 0) {
-         Emsg2(M_FATAL, 0, _("<stored: net_recv len=%d: ERR=%s\n"), len, bnet_strerror(sd));
+         Jmsg(jcr, M_FATAL, 0, _("<stored: net_recv len=%d: ERR=%s\n"), len, bnet_strerror(sd));
         jcr->JobStatus = JS_ErrorTerminated;
       }
    }
@@ -591,6 +593,7 @@ cleanup:
 static int verify_cmd(JCR *jcr)
 { 
    BSOCK *dir = jcr->dir_bsock;
+   BSOCK *sd  = jcr->store_bsock;
    char level[100];
 
    jcr->JobType = JT_VERIFY;
@@ -603,18 +606,44 @@ static int verify_cmd(JCR *jcr)
    } else if (strcasecmp(level, "catalog") == 0){
       jcr->JobLevel = L_VERIFY_CATALOG;
    } else if (strcasecmp(level, "volume") == 0){
-      jcr->JobLevel = L_VERIFY_VOLUME;
+      jcr->JobLevel = L_VERIFY_VOLUME_TO_CATALOG;
    } else if (strcasecmp(level, "data") == 0){
       jcr->JobLevel = L_VERIFY_DATA;
    } else {   
-      bnet_fsend(dir, "2994 Bad verify command: %s\n", dir->msg);
+      bnet_fsend(dir, "2994 Bad verify level: %s\n", dir->msg);
       return 0;   
    }
 
    bnet_fsend(dir, OKverify);
    Dmsg1(10, "bfiled>dird: %s", dir->msg);
 
-   do_verify(jcr);
+   switch (jcr->JobLevel) {
+   case L_VERIFY_INIT:
+   case L_VERIFY_CATALOG:
+      do_verify(jcr);
+      break;
+   case L_VERIFY_VOLUME_TO_CATALOG:
+      if (!open_sd_read_session(jcr)) {
+        return 0;
+      }
+      do_verify_volume(jcr);
+      /* 
+       * Send Close session command to Storage daemon
+       */
+      bnet_fsend(sd, read_close, jcr->Ticket);
+      Dmsg1(30, "bfiled>stored: %s", sd->msg);
+
+      /* ****FIXME**** check response */
+      bnet_recv(sd);                    /* get OK */
+
+      /* Inform Storage daemon that we are done */
+      bnet_sig(sd, BNET_EOF);
+
+      break;
+   default:
+      bnet_fsend(dir, "2994 Bad verify level: %s\n", dir->msg);
+      return 0; 
+   }
 
    /* Inform Director that we are done */
    return bnet_sig(dir, BNET_EOF);
@@ -785,7 +814,7 @@ int response(BSOCK *sd, char *resp, char *cmd)
 static int send_bootstrap_file(JCR *jcr)
 {
    FILE *bs;
-   char buf[1000];
+   char buf[2000];
    BSOCK *sd = jcr->store_bsock;
    char *bootstrap = "bootstrap\n";
 
index 7072b44f06638a3cd9bef5e966ff0a29a937b820..c1cb4fd2ce3affedc9f6cfdef664c810563c0a03 100644 (file)
@@ -24,6 +24,7 @@
 
 extern int blast_data_to_storage_daemon(JCR *jcr, char *addr, int port);
 extern void do_verify(JCR *jcr);
+extern void do_verify_volume(JCR *jcr);
 extern void do_restore(JCR *jcr);
 extern int authenticate_director(JCR *jcr);
 extern int authenticate_storagedaemon(JCR *jcr);
index c892bff19a52f36700fe93d1c01e6aead219b362..6bce564013c854c4bb484467184d47abfe7d4c12 100644 (file)
@@ -80,7 +80,7 @@ void do_restore(JCR *jcr)
    /* 
     * Get a record from the Storage daemon
     */
-   while (bnet_recv(sd) > 0) {
+   while (bnet_recv(sd) > 0 && !job_cancelled(jcr)) {
       /*
        * First we expect a Stream Record Header 
        */
@@ -94,7 +94,7 @@ void do_restore(JCR *jcr)
       /* 
        * Now we expect the Stream Data
        */
-      if (bnet_recv(sd) < 0) {
+      if (bnet_recv(sd) < 0 && !job_cancelled(jcr)) {
          Jmsg1(jcr, M_FATAL, 0, _("Data record error. ERR=%s\n"), bnet_strerror(sd));
       }
       if (size != ((uint32_t) sd->msglen)) {
@@ -123,13 +123,13 @@ void do_restore(JCR *jcr)
         }
 
         if ((int)sizeof_pool_memory(fname) <  sd->msglen) {
-           fname = (char *) realloc_pool_memory(fname, sd->msglen + 1);
+           fname = realloc_pool_memory(fname, sd->msglen + 1);
         }
         if (sizeof_pool_memory(ofile) < sizeof_pool_memory(fname) + wherelen + 1) {
-           ofile = (char *) realloc_pool_memory(ofile, sizeof_pool_memory(fname) + wherelen + 1);
+           ofile = realloc_pool_memory(ofile, sizeof_pool_memory(fname) + wherelen + 1);
         }
         if ((int)sizeof_pool_memory(lname) < sd->msglen) {
-           ofile = (char *) realloc_pool_memory(ofile, sd->msglen + 1);
+           lname = realloc_pool_memory(lname, sd->msglen + 1);
         }
         *fname = 0;
         *lname = 0;
@@ -163,7 +163,7 @@ void do_restore(JCR *jcr)
         /* Save filename and position to attributes */
         fp = fname;
         while (*ap != 0) {
-           *fp++  = *ap++;
+           *fp++  = *ap++;           /* copy filename to fname */
         }
         *fp = *ap++;                 /* terminate filename & point to attribs */
 
index a3af127d77f5b9621dc4508591d9c173950b8cc3..63cb2ccc3d5b7b0bf36504dbbb9dab32ba24012c 100644 (file)
@@ -76,6 +76,10 @@ static int verify_file(FF_PKT *ff_pkt, void *pkt)
    BSOCK *sd, *dir;
    JCR *jcr = (JCR *)pkt;
 
+   if (job_cancelled(jcr)) {
+      return 0;
+   }
+   
    sd = jcr->store_bsock;
    dir = jcr->dir_bsock;
 
diff --git a/bacula/src/filed/verify_vol.c b/bacula/src/filed/verify_vol.c
new file mode 100644 (file)
index 0000000..4173076
--- /dev/null
@@ -0,0 +1,269 @@
+/*
+ *  Bacula File Daemon verify-vol.c Verify files on a Volume
+ *    versus attributes in Catalog
+ *
+ *    Kern Sibbald, July MMII
+ *
+ *   Version $Id$
+ *
+ */
+/*
+   Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
+
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2 of
+   the License, or (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public
+   License along with this program; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+   MA 02111-1307, USA.
+
+ */
+
+#include "bacula.h"
+#include "filed.h"
+
+/* Data received from Storage Daemon */
+static char rec_header[] = "rechdr %ld %ld %ld %ld %ld";
+
+/* Forward referenced functions */
+#ifdef needed
+static void print_ls_output(JCR *jcr, char *fname, char *lname, int type, struct stat *statp);
+#endif
+
+
+/* 
+ * Verify attributes of the requested files on the Volume
+ * 
+ */
+void do_verify_volume(JCR *jcr)
+{
+   BSOCK *sd, *dir;
+   POOLMEM *fname;                   /* original file name */
+   POOLMEM *lname;                   /* link name */
+   int32_t stream;
+   uint32_t size;
+   uint32_t VolSessionId, VolSessionTime, file_index;
+   uint32_t record_file_index;
+   int type, stat;
+   
+   sd = jcr->store_bsock;
+   if (!sd) {
+      Jmsg(jcr, M_FATAL, 0, _("Storage command not issued before Verify.\n"));
+      jcr->JobStatus = JS_FatalError;
+      return;
+   }
+   dir = jcr->dir_bsock;
+   jcr->JobStatus = JS_Running;
+
+   if (!bnet_set_buffer_size(sd, MAX_NETWORK_BUFFER_SIZE, BNET_SETBUF_READ)) {
+      jcr->JobStatus = JS_FatalError;
+      return;
+   }
+   jcr->buf_size = sd->msglen;
+
+   fname = get_pool_memory(PM_FNAME);
+   lname = get_pool_memory(PM_FNAME);
+
+   /* 
+    * Get a record from the Storage daemon
+    */
+   while (bnet_recv(sd) > 0 && !job_cancelled(jcr)) {
+      /*
+       * First we expect a Stream Record Header 
+       */
+      if (sscanf(sd->msg, rec_header, &VolSessionId, &VolSessionTime, &file_index,
+         &stream, &size) != 5) {
+         Jmsg1(jcr, M_FATAL, 0, _("Record header scan error: %s\n"), sd->msg);
+        goto bail_out;
+      }
+      Dmsg2(30, "Got hdr: FilInx=%d Stream=%d.\n", file_index, stream);
+
+      /* 
+       * Now we expect the Stream Data
+       */
+      if (bnet_recv(sd) < 0 && !job_cancelled(jcr)) {
+         Jmsg1(jcr, M_FATAL, 0, _("Data record error. ERR=%s\n"), bnet_strerror(sd));
+        goto bail_out;
+      }
+      if (size != ((uint32_t)sd->msglen)) {
+         Jmsg2(jcr, M_FATAL, 0, _("Actual data size %d not same as header %d\n"), sd->msglen, size);
+        goto bail_out;
+      }
+      Dmsg1(30, "Got stream data, len=%d\n", sd->msglen);
+
+      /* File Attributes stream */
+      if (stream == STREAM_UNIX_ATTRIBUTES) {
+        char *ap, *lp, *fp;
+
+         Dmsg0(400, "Stream=Unix Attributes.\n");
+
+        if ((int)sizeof_pool_memory(fname) < sd->msglen) {
+           fname = realloc_pool_memory(fname, sd->msglen + 1);
+        }
+
+        if ((int)sizeof_pool_memory(lname) < sd->msglen) {
+           lname = realloc_pool_memory(lname, sd->msglen + 1);
+        }
+        *fname = 0;
+        *lname = 0;
+
+        /*              
+         * An Attributes record consists of:
+         *    File_index
+         *    Type   (FT_types)
+         *    Filename
+         *    Attributes
+         *    Link name (if file linked i.e. FT_LNK)
+         *
+         */
+         if (sscanf(sd->msg, "%d %d", &record_file_index, &type) != 2) {
+            Jmsg(jcr, M_FATAL, 0, _("Error scanning record header: %s\n"), sd->msg);
+            Dmsg0(0, "\nError scanning header\n");
+           goto bail_out;
+        }
+         Dmsg2(30, "Got Attr: FilInx=%d type=%d\n", record_file_index, type);
+        if (record_file_index != file_index) {
+            Jmsg(jcr, M_FATAL, 0, _("Record header file index %ld not equal record index %ld\n"),
+              file_index, record_file_index);
+            Dmsg0(0, "File index error\n");
+           goto bail_out;
+        }
+        ap = sd->msg;
+         while (*ap++ != ' ')         /* skip record file index */
+           ;
+         while (*ap++ != ' ')         /* skip type */
+           ;
+        /* Save filename and position to attributes */
+        fp = fname;     
+        while (*ap != 0) {
+           *fp++  = *ap++;           /* copy filename to fname */
+        }
+        *fp = *ap++;                 /* terminate filename & point to attribs */
+
+         Dmsg1(200, "Attr=%s\n", ap);
+        /* Skip to Link name */
+        if (type == FT_LNK) {
+           lp = ap;
+           while (*lp++ != 0) {
+              ;
+           }
+            strcat(lname, lp);        /* "save" link name */
+        } else {
+           *lname = 0;
+        }
+        jcr->JobFiles++;
+        jcr->num_files_examined++;
+
+        /* 
+         * Send file attributes to Director
+         *   File_index
+         *   Stream
+         *   Verify Options
+         *   Filename (full path)
+         *   Encoded attributes
+         *   Link name (if type==FT_LNK)
+         * For a directory, link is the same as fname, but with trailing
+         * slash. For a linked file, link is the link.
+         */
+        /* Send file attributes to Director */
+         Dmsg2(200, "send ATTR inx=%d fname=%s\n", jcr->JobFiles, fname);
+        if (type == FT_LNK) {
+            stat = bnet_fsend(dir, "%d %d %s %s%c%s%c%s%c", jcr->JobFiles,
+                          STREAM_UNIX_ATTRIBUTES, "pinsug5", fname, 
+                         0, ap, 0, lname, 0);
+        } else {
+            stat = bnet_fsend(dir,"%d %d %s %s%c%s%c%c", jcr->JobFiles,
+                          STREAM_UNIX_ATTRIBUTES, "pinsug5", fname, 
+                         0, ap, 0, 0);
+        }
+         Dmsg2(200, "bfiled>bdird: attribs len=%d: msg=%s\n", dir->msglen, dir->msg);
+        if (!stat) {
+            Jmsg(jcr, M_FATAL, 0, _("Network error in send to Director: ERR=%s\n"), bnet_strerror(dir));
+           goto bail_out;
+        }
+
+
+      /* Data stream */
+      } else if (stream == STREAM_FILE_DATA) {
+
+       /* Do nothing */
+       
+      /* GZIP data stream */
+      } else if (stream == STREAM_GZIP_DATA) {
+
+       /* Do nothing */
+
+      /* If MD5 stream */
+      } else if (stream == STREAM_MD5_SIGNATURE) {
+        char MD5buf[30];
+        bin_to_base64(MD5buf, (char *)sd->msg, 16); /* encode 16 bytes */
+         Dmsg2(400, "send inx=%d MD5=%s\n", jcr->JobFiles, MD5buf);
+         bnet_fsend(dir, "%d %d %s *MD5-%d*", jcr->JobFiles, STREAM_MD5_SIGNATURE, MD5buf,
+           jcr->JobFiles);
+         Dmsg2(20, "bfiled>bdird: MD5 len=%d: msg=%s\n", dir->msglen, dir->msg);
+  
+      } else if (stream != STREAM_MD5_SIGNATURE) {
+         Pmsg2(0, "None of above!!! stream=%d data=%s\n", stream,sd->msg);
+      }
+   }
+
+bail_out:
+   if (jcr->compress_buf) {
+      free(jcr->compress_buf);
+      jcr->compress_buf = NULL;
+   }
+   free_pool_memory(fname);
+   free_pool_memory(lname);
+   Dmsg2(050, "End Verify-Vol. Files=%d Bytes=%" lld "\n", jcr->JobFiles,
+      jcr->JobBytes);
+}         
+
+extern char *getuser(uid_t uid);
+extern char *getgroup(gid_t gid);
+
+/*
+ * Print an ls style message, also send INFO
+ */
+#ifdef needed
+static void print_ls_output(JCR *jcr, char *fname, char *lname, int type, struct stat *statp)
+{
+   char buf[2000]; 
+   char ec1[30];
+   char *p, *f;
+   int n;
+
+   p = encode_mode(statp->st_mode, buf);
+   n = sprintf(p, "  %2d ", (uint32_t)statp->st_nlink);
+   p += n;
+   n = sprintf(p, "%-8.8s %-8.8s", getuser(statp->st_uid), getgroup(statp->st_gid));
+   p += n;
+   n = sprintf(p, "%8.8s ", edit_uint64(statp->st_size, ec1));
+   p += n;
+   p = encode_time(statp->st_ctime, p);
+   *p++ = ' ';
+   *p++ = ' ';
+   for (f=fname; *f && (p-buf) < (int)sizeof(buf); )
+      *p++ = *f++;
+   if (type == FT_LNK) {
+      *p++ = ' ';
+      *p++ = '-';
+      *p++ = '>';
+      *p++ = ' ';
+      /* Copy link name */
+      for (f=lname; *f && (p-buf) < (int)sizeof(buf); )
+        *p++ = *f++;
+   }
+   *p++ = '\n';
+   *p = 0;
+   Dmsg0(20, buf);
+   Jmsg(jcr, M_INFO, 0, buf);
+}
+#endif
index 1408f17a2b78994f2e8a7abb424a56247746ad22..2c5d1a07412c776fba683ad0e3c2ef17297a6d40 100755 (executable)
 #define FO_GZIP     0x2               /* Do Zlib compression */
 
 
-#define OPT_compute_MD5       0x01
-#define OPT_GZIP_compression  0x02
-#define OPT_no_recursion      0x04
+#define OPT_compute_MD5       0x01    /* compute MD5 of file's data */
+#define OPT_GZIP_compression  0x02    /* use GZIP compression */
+#define OPT_no_recursion      0x04    /* no recursion in directories */
+#define OPT_multifs           0x08    /* multiple file systems */
 
 
 struct s_included_file {
index dcb0381b90a86d6560b8f6803f71c41d14aad86d..8f6c3ae98259d792b93f09591ab925728ebcacb5 100755 (executable)
@@ -1,24 +1,27 @@
 /* 
+   Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
 
-   Copyright 1988, 92,93,94,95,96,97, 1999 Free Software Foundation, Inc.
-   Written by John Gilmore, starting 1985-08-25.
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2 of
+   the License, or (at your option) any later version.
 
-   This program is free software; you can redistribute it and/or modify it
-   under the terms of the GNU General Public License as published by the
-   Free Software Foundation; either version 2, or (at your option) any later
-   version.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
 
-   This program is distributed in the hope that it will be useful, but
-   WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
-   Public License for more details.
+   You should have received a copy of the GNU General Public
+   License along with this program; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+   MA 02111-1307, USA.
 
-   You should have received a copy of the GNU General Public License along
-   with this program; if not, write to the Free Software Foundation, Inc.,
-   59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.    
+   This file is based on GNU TAR source code. Except for a few key
+   ideas and some key snippets of code, it has been rewritten for Bacula.
 
-   Massively changed from GNU TAR source code to adapt to Bacula
-   by Kern Sibbald, MM
+      Kern Sibbald, MM
+
+   Many thanks to the TAR programmers.
 
  */
 
@@ -35,11 +38,6 @@ int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
 #endif
 
 
-/* ****FIXME**** debug until stable */
-#undef bmalloc
-#define bmalloc(x) sm_malloc(__FILE__, __LINE__, x)
-
-
 /*
  * Structure for keeping track of hard linked files
  */
@@ -68,284 +66,266 @@ struct utimbuf
  * handle_file is the callback for handling the file.
  * p is the filename
  * parent_device is the device we are currently on 
- * top_level is 1 when not recursing.
+ * top_level is 1 when not recursing or 0 when 
+ *  decending into a directory.
  */
 int
 find_one_file(FF_PKT *ff_pkt, int handle_file(FF_PKT *ff, void *hpkt), void *pkt, 
                            char *p, dev_t parent_device, int top_level)
 {
-  struct utimbuf restore_times;
-  int rtn_stat;
-
-  ff_pkt->fname = ff_pkt->link = p;
-  if (ff_pkt->compute_MD5) {
-     ff_pkt->flags |= FO_MD5;
-  }
-  if (ff_pkt->GZIP_compression) {
-     ff_pkt->flags |= FO_GZIP;
-  }
-
-  /* Use stat if following (rather than dumping) 4.2BSD's symbolic links.
-     Otherwise, use lstat (which falls back to stat if no symbolic links).  */
-
-  if (ff_pkt->dereference != 0
-#if STX_HIDDEN && !_LARGE_FILES /* AIX */
-      ? statx(p, &ff_pkt->statp, STATSIZE, STX_HIDDEN)
-      : statx(p, &ff_pkt->statp, STATSIZE, STX_HIDDEN | STX_LINK)
-#else
-      ? stat(p, &ff_pkt->statp) : lstat(p, &ff_pkt->statp)
-#endif
-      )
-    {
-      /* Cannot stat file */
-      ff_pkt->type = FT_NOSTAT;
-      ff_pkt->ff_errno = errno;
-      return handle_file(ff_pkt, pkt);
-    }
-
-Dmsg1(60, "File ----: %s\n", p);
-if (S_ISLNK(ff_pkt->statp.st_mode))
-   Dmsg1(60, "Link-------------: %s \n", p);
-
-  /* Save current times of this directory in case we need to
-   * reset them because the user doesn't want them changed.
-   */
-  restore_times.actime = ff_pkt->statp.st_atime;
-  restore_times.modtime = ff_pkt->statp.st_mtime;
-
-
-#ifdef S_ISHIDDEN
-  if (S_ISHIDDEN(ff_pkt->statp.st_mode)) {
-      char *new = alloca(strlen(p) + 2);
-      if (new) {
-         strcpy (new, p);
-          strcat (new, "@");
-         p = new;
-         ff_pkt->link = p;
-      }
-  }
+   struct utimbuf restore_times;
+   int rtn_stat;
+
+   ff_pkt->fname = ff_pkt->link = p;
+   if (ff_pkt->compute_MD5) {
+      ff_pkt->flags |= FO_MD5;
+   }
+   if (ff_pkt->GZIP_compression) {
+      ff_pkt->flags |= FO_GZIP;
+   }
+
+   if (lstat(p, &ff_pkt->statp) != 0) {
+       /* Cannot stat file */
+       ff_pkt->type = FT_NOSTAT;
+       ff_pkt->ff_errno = errno;
+       return handle_file(ff_pkt, pkt);
+   }
+
+   Dmsg1(60, "File ----: %s\n", p);
+#ifdef DEBUG
+   if (S_ISLNK(ff_pkt->statp.st_mode))
+      Dmsg1(60, "Link-------------: %s \n", p);
 #endif
 
-  /* See if we want only new files, and check if this one is too old to
-     put in the archive.  */
-
-  if (ff_pkt->incremental && !S_ISDIR(ff_pkt->statp.st_mode)) {
-     Dmsg1(100, "Non-directory incremental: %s\n", ff_pkt->fname);
-     /* Not a directory */
-     if (ff_pkt->statp.st_mtime < ff_pkt->save_time
-        && (ff_pkt->mtime_only || 
-            ff_pkt->statp.st_ctime < ff_pkt->save_time)) {
-       /* Incremental option, file not changed */
-       ff_pkt->type = FT_NOCHG;
-        Dmsg1(100, "File not changed: %s\n", ff_pkt->fname);
-        Dmsg4(200, "save_time=%d mtime=%d mtime_only=%d st_ctime=%d\n",
-          ff_pkt->save_time, ff_pkt->statp.st_mtime, 
-          ff_pkt->mtime_only, ff_pkt->statp.st_ctime);
-       return handle_file(ff_pkt, pkt);
-     }
-  }
+   /* Save current times of this directory in case we need to
+    * reset them because the user doesn't want them changed.
+    */
+   restore_times.actime = ff_pkt->statp.st_atime;
+   restore_times.modtime = ff_pkt->statp.st_mtime;
+
+
+   /* 
+    * If this is an Incremental backup, see if file was modified
+    * since our last "save_time", presumably the last Full save
+    * or Incremental.
+    */
+   if (ff_pkt->incremental && !S_ISDIR(ff_pkt->statp.st_mode)) {
+      Dmsg1(100, "Non-directory incremental: %s\n", ff_pkt->fname);
+      /* Not a directory */
+      if (ff_pkt->statp.st_mtime < ff_pkt->save_time
+         && (ff_pkt->mtime_only || 
+             ff_pkt->statp.st_ctime < ff_pkt->save_time)) {
+        /* Incremental option, file not changed */
+        ff_pkt->type = FT_NOCHG;
+         Dmsg1(100, "File not changed: %s\n", ff_pkt->fname);
+         Dmsg4(200, "save_time=%d mtime=%d mtime_only=%d st_ctime=%d\n",
+           ff_pkt->save_time, ff_pkt->statp.st_mtime, 
+           ff_pkt->mtime_only, ff_pkt->statp.st_ctime);
+        return handle_file(ff_pkt, pkt);
+      }
+   }
 
 #if xxxxxxx
-  /* See if we are trying to dump the archive. */
-  if (ar_dev && ff_pkt->statp.st_dev == ar_dev && ff_pkt->statp.st_ino == ar_ino) {
-      ff_pkt->type = FT_ISARCH;
-      return handle_file(ff_pkt, pkt);
-  }
+   /* See if we are trying to dump the archive.  */
+   if (ar_dev && ff_pkt->statp.st_dev == ar_dev && ff_pkt->statp.st_ino == ar_ino) {
+       ff_pkt->type = FT_ISARCH;
+       return handle_file(ff_pkt, pkt);
+   }
 #endif
 
-  /* Check for multiple links.
-     NOTE: CTG is Masscomp contiguous files  
-
-     We maintain a list of all such files that we've written so far.  Any
-     time we see another, we check the list and avoid dumping the data
-     again if we've done it once already.  */
-
-  if (ff_pkt->statp.st_nlink > 1
-      && (S_ISREG(ff_pkt->statp.st_mode)
-         || S_ISCTG(ff_pkt->statp.st_mode)
-         || S_ISCHR(ff_pkt->statp.st_mode)
-         || S_ISBLK(ff_pkt->statp.st_mode)
-         || S_ISFIFO(ff_pkt->statp.st_mode)
-         || S_ISSOCK(ff_pkt->statp.st_mode))) {
-
-      struct f_link *lp;
-
-      /* FIXME: First quick and dirty. Hashing, etc later.  */
-      for (lp = ff_pkt->linklist; lp; lp = lp->next)
-        if (lp->ino == ff_pkt->statp.st_ino && lp->dev == ff_pkt->statp.st_dev) {
-            ff_pkt->link = lp->name;
-            ff_pkt->type = FT_LNKSAVED;
-            return handle_file(ff_pkt, pkt);
-        }
-
-      /* Not found.  Add it to the list of possible links.  */
-
-      lp = (struct f_link *)bmalloc(sizeof (struct f_link) + strlen(p));
-      lp->ino = ff_pkt->statp.st_ino;
-      lp->dev = ff_pkt->statp.st_dev;
-      strcpy (lp->name, p);
-      lp->next = ff_pkt->linklist;
-      ff_pkt->linklist = lp;
-  }
-
-  /* This is not a link to a previously dumped file, so dump it.  */
-  if (S_ISREG(ff_pkt->statp.st_mode) || S_ISCTG(ff_pkt->statp.st_mode)) {
-      off_t sizeleft;
-      int header_moved;
-
-      header_moved = 0;
-
-      sizeleft = ff_pkt->statp.st_size;
-
-      /* Don't bother opening empty, world readable files.  Also do not open
-        files when archive is meant for /dev/null.  */
-      if (ff_pkt->null_output_device || (sizeleft == 0
-             && MODE_R == (MODE_R & ff_pkt->statp.st_mode))) {
-        ff_pkt->type = FT_REGE;
-      } else {
-        ff_pkt->type = FT_REG;
-      }
-      return handle_file(ff_pkt, pkt);
-
-  } else if (S_ISLNK(ff_pkt->statp.st_mode)) {
-      int size;
-      char *buffer = (char *)alloca(PATH_MAX + 1);
+   /* 
+    * Handle hard linked files
+    *
+    * Maintain a list of hard linked files already backed up. This
+    *  allows us to ensure that the data ofeach file gets backed 
+    *  up only once.
+    */
+   if (ff_pkt->statp.st_nlink > 1
+       && (S_ISREG(ff_pkt->statp.st_mode)
+          || S_ISCHR(ff_pkt->statp.st_mode)
+          || S_ISBLK(ff_pkt->statp.st_mode)
+          || S_ISFIFO(ff_pkt->statp.st_mode)
+          || S_ISSOCK(ff_pkt->statp.st_mode))) {
+
+       struct f_link *lp;
+
+       /* keep linked list of files */
+       for (lp = ff_pkt->linklist; lp; lp = lp->next)
+         if (lp->ino == ff_pkt->statp.st_ino && lp->dev == ff_pkt->statp.st_dev) {
+             ff_pkt->link = lp->name;
+             ff_pkt->type = FT_LNKSAVED;       /* Handle link, file already saved */
+             return handle_file(ff_pkt, pkt);
+         }
 
-      size = readlink(p, buffer, PATH_MAX + 1);
-      if (size < 0) {
-         /* Could not follow link */                             
-         ff_pkt->type = FT_NOFOLLOW;
-         ff_pkt->ff_errno = errno;
-         return handle_file(ff_pkt, pkt);
-      }
-      buffer[size] = '\0';
-      ff_pkt->link = buffer;
-      ff_pkt->type = FT_LNK;          /* got a real link */
-      return handle_file(ff_pkt, pkt);
-
-  } else if (S_ISDIR(ff_pkt->statp.st_mode)) {
-      DIR *directory;
-      struct dirent *entry, *result;
-      char *namebuf;
-      size_t buflen;
-      size_t len;
-      int status;
-      dev_t our_device = ff_pkt->statp.st_dev;
-
-      if (access(p, R_OK) == -1 && geteuid () != 0) {
-         /* Could not access() directory */
-         ff_pkt->type = FT_NOACCESS;
-         ff_pkt->ff_errno = errno;
+       /* File not previously dumped. Chain it into our list. */
+       lp = (struct f_link *)bmalloc(sizeof (struct f_link) + strlen(p));
+       lp->ino = ff_pkt->statp.st_ino;
+       lp->dev = ff_pkt->statp.st_dev;
+       strcpy (lp->name, p);
+       lp->next = ff_pkt->linklist;
+       ff_pkt->linklist = lp;
+   }
+
+   /* This is not a link to a previously dumped file, so dump it.  */
+   if (S_ISREG(ff_pkt->statp.st_mode)) {
+       off_t sizeleft;
+
+       sizeleft = ff_pkt->statp.st_size;
+
+       /* Don't bother opening empty, world readable files.  Also do not open
+         files when archive is meant for /dev/null.  */
+       if (ff_pkt->null_output_device || (sizeleft == 0
+              && MODE_R == (MODE_R & ff_pkt->statp.st_mode))) {
+         ff_pkt->type = FT_REGE;
+       } else {
+         ff_pkt->type = FT_REG;
+       }
+       return handle_file(ff_pkt, pkt);
+
+   } else if (S_ISLNK(ff_pkt->statp.st_mode)) {
+       int size;
+       char *buffer = (char *)alloca(PATH_MAX + 1);
+
+       size = readlink(p, buffer, PATH_MAX + 1);
+       if (size < 0) {
+          /* Could not follow link */                             
+          ff_pkt->type = FT_NOFOLLOW;
+          ff_pkt->ff_errno = errno;
+          return handle_file(ff_pkt, pkt);
+       }
+       buffer[size] = '\0';
+       ff_pkt->link = buffer;
+       ff_pkt->type = FT_LNK;          /* got a real link */
+       return handle_file(ff_pkt, pkt);
+
+   } else if (S_ISDIR(ff_pkt->statp.st_mode)) {
+       DIR *directory;
+       struct dirent *entry, *result;
+       char *namebuf;
+       size_t buflen;
+       size_t len;
+       int status;
+       dev_t our_device = ff_pkt->statp.st_dev;
+
+       if (access(p, R_OK) == -1 && geteuid() != 0) {
+          /* Could not access() directory */
+          ff_pkt->type = FT_NOACCESS;
+          ff_pkt->ff_errno = errno;
+          return handle_file(ff_pkt, pkt);
+       }
+
+       /* Build new prototype name.  Ensure exactly one trailing slash.  */
+       len = strlen(p);
+       buflen = len + NAME_FIELD_SIZE;
+       namebuf = (char *)bmalloc(buflen + 2);
+       strncpy(namebuf, p, buflen);
+       while (len >= 1 && namebuf[len - 1] == '/')
+        len--;
+       namebuf[len++] = '/';
+       namebuf[len] = '\0';
+
+       ff_pkt->link = namebuf;
+       if (ff_pkt->incremental &&
+          (ff_pkt->statp.st_mtime < ff_pkt->save_time &&
+           ff_pkt->statp.st_ctime < ff_pkt->save_time)) {
+         /* Incremental option, directory entry not changed */
+         ff_pkt->type = FT_DIRNOCHG;
+       } else {
+         ff_pkt->type = FT_DIR;
+       }
+       handle_file(ff_pkt, pkt);       /* handle directory entry */
+
+       ff_pkt->link = ff_pkt->fname;     /* reset "link" */
+
+       /* 
+       * Do not decend into subdirectories (recurse) if the
+       * user has turned it off for this directory.
+       */
+       if (ff_pkt->no_recursion) {
+         free(namebuf);
+         /* No recursion into this directory */
+         ff_pkt->type = FT_NORECURSE;
          return handle_file(ff_pkt, pkt);
-      }
-
-      /* Build new prototype name.  Ensure exactly one trailing slash. */
-      len = strlen(p);
-      buflen = len + NAME_FIELD_SIZE;
-      namebuf = (char *)bmalloc(buflen + 2);
-      strncpy(namebuf, p, buflen);
-      while (len >= 1 && namebuf[len - 1] == '/')
-       len--;
-      namebuf[len++] = '/';
-      namebuf[len] = '\0';
-
-      ff_pkt->link = namebuf;
-      if (ff_pkt->incremental &&
-         (ff_pkt->statp.st_mtime < ff_pkt->save_time &&
-          ff_pkt->statp.st_ctime < ff_pkt->save_time)) {
-        /* Incremental option, directory entry not changed */
-        ff_pkt->type = FT_DIRNOCHG;
-      } else {
-        ff_pkt->type = FT_DIR;
-      }
-      handle_file(ff_pkt, pkt);       /* handle directory entry */
-
-      ff_pkt->link = ff_pkt->fname;     /* reset "link" */
-
-      /* See if we are about to recurse into a directory, and avoid doing
-        so if the user wants that we do not descend into directories.  */
-
-      if (ff_pkt->no_recursion) {
-        free(namebuf);
-        /* No recursion into this directory */
-        ff_pkt->type = FT_NORECURSE;
-        return handle_file(ff_pkt, pkt);
-      }
-
-      /* See if we are crossing from one file system to another, and
-        avoid doing so if the user only wants to dump one file system.  */
-
-      if (ff_pkt->one_file_system && !top_level
-         && parent_device != ff_pkt->statp.st_dev) {
+       }
+
+       /* 
+       * See if we are crossing file systems, and
+       * avoid doing so if the user only wants to dump one file system.
+       */
+       if (ff_pkt->one_file_system && !top_level
+          && parent_device != ff_pkt->statp.st_dev) {
          free(namebuf);
          ff_pkt->type = FT_NOFSCHG;
          return handle_file(ff_pkt, pkt);
-      }
+       }
 
-      /* Now output all the files in the directory.  */
-
-      errno = 0;               /* FIXME: errno should be read-only */
-
-      if ((directory = opendir(p)) == NULL) {
+       /* 
+       * Now process the files in this directory.
+       */
+       errno = 0;
+       if ((directory = opendir(p)) == NULL) {
          free(namebuf);
          ff_pkt->type = FT_NOOPEN;
          ff_pkt->ff_errno = errno;
          return handle_file(ff_pkt, pkt);
-      }
-
-      /* FIXME: Should speed this up by cd-ing into the dir.  */
-
-      rtn_stat = 1;
-      entry = (struct dirent *)malloc(sizeof(struct dirent) + name_max + 10);
-      for ( ;; ) {
-         char *p;
-
-         status  = readdir_r(directory, entry, &result);
-          Dmsg3(200, "readdir stat=%d result=%x name=%s\n", status, result,
-            entry->d_name);
-         if (status != 0 || result == NULL) {
-            break;
-         }
-         p = entry->d_name;
-          /* Skip `.', `..', and excluded file names.  */
-          if (p[0] == '\0' || (p[0] == '.' && (p[1] == '\0' ||
-              (p[1] == '.' && p[2] == '\0')))) {
-            continue;
-         }
-
-         if ((int)NAMLEN(entry) + len >= buflen) {
-             buflen = len + NAMLEN(entry);
-             namebuf = (char *)brealloc(namebuf, buflen + 2);
-         }
-         strcpy(namebuf + len, entry->d_name);
-         if (!file_is_excluded(ff_pkt, namebuf)) {
-            rtn_stat = find_one_file(ff_pkt, handle_file, pkt, namebuf, our_device, 0);
-         }
-      }
-      closedir(directory);
-      free(namebuf);
-      free(entry);
-      if (ff_pkt->atime_preserve) {
-        utime(p, &restore_times);
-      }
-      return rtn_stat;
-  } /* end check for directory */
-
-  /* The only remaining types are special (character, ...) files */
-  ff_pkt->type = FT_SPEC;
-  return handle_file(ff_pkt, pkt);
+       }
+
+       /*
+       * This could possibly run faster if we chdir to the directory
+       * before traversing it.
+       */
+       rtn_stat = 1;
+       entry = (struct dirent *)malloc(sizeof(struct dirent) + name_max + 10);
+       for ( ;; ) {
+          char *p;
+
+          status  = readdir_r(directory, entry, &result);
+           Dmsg3(200, "readdir stat=%d result=%x name=%s\n", status, result,
+             entry->d_name);
+          if (status != 0 || result == NULL) {
+             break;
+          }
+          p = entry->d_name;
+           /* Skip `.', `..', and excluded file names.  */
+           if (p[0] == '\0' || (p[0] == '.' && (p[1] == '\0' ||
+               (p[1] == '.' && p[2] == '\0')))) {
+             continue;
+          }
+
+          if ((int)NAMLEN(entry) + len >= buflen) {
+              buflen = len + NAMLEN(entry);
+              namebuf = (char *)brealloc(namebuf, buflen + 2);
+          }
+          strcpy(namebuf + len, entry->d_name);
+          if (!file_is_excluded(ff_pkt, namebuf)) {
+             rtn_stat = find_one_file(ff_pkt, handle_file, pkt, namebuf, our_device, 0);
+          }
+       }
+       closedir(directory);
+       free(namebuf);
+       free(entry);
+       if (ff_pkt->atime_preserve) {
+         utime(p, &restore_times);
+       }
+       return rtn_stat;
+   } /* end check for directory */
+
+   /* The only remaining types are special (character, ...) files */
+   ff_pkt->type = FT_SPEC;
+   return handle_file(ff_pkt, pkt);
 }
 
 void term_find_one(FF_PKT *ff)
 {
-  struct f_link *lp, *lc;
+   struct f_link *lp, *lc;
   
-  /* Free up list of hard linked files */
-  for (lp = ff->linklist; lp;) {
-     lc = lp;
-     lp = lp->next;
-     if (lc)
-       free(lc);
-  }
-  return;
+   /* Free up list of hard linked files */
+   for (lp = ff->linklist; lp;) {
+      lc = lp;
+      lp = lp->next;
+      if (lc) {
+        free(lc);
+      }
+   }
+   return;
 }
index 2dd9700d6f910e5dfe7887cd59f760fc32dc9674..2b01f3d10041afe83ed6c9158bedb8eafd25052e 100644 (file)
@@ -117,6 +117,9 @@ void add_fname_to_include_list(FF_PKT *ff, int prefixed, char *fname)
             case 'h':                  /* no recursion */
               inc->options |= OPT_no_recursion;
               break;
+            case 'f':
+              inc->options |= OPT_multifs;
+              break;
             case 'V':                  /* verify options */
               /* Copy Verify Options */
                for (j=0; *p && *p != ':'; p++) {
@@ -216,6 +219,11 @@ struct s_included_file *get_next_included_file(FF_PKT *ff, struct s_included_fil
       } else {
         ff->no_recursion = 0;
       }
+      if (inc->options & OPT_multifs) {
+        ff->one_file_system = 0;
+      } else {
+        ff->one_file_system = 1;
+      }
    }
    return inc;
 }
index d88b54df1e80dcde98afce071b82e8fe553a3410..db4574600dc5e0cfa83dd14a89efe0f25f93ae6e 100644 (file)
@@ -32,7 +32,7 @@
 #ifndef __JCR_H_
 #define __JCR_H_ 1
 
-/* Backup/Verify level code */
+/* Backup/Verify level code. These are stored in the DB */
 #define L_FULL                   'F'
 #define L_INCREMENTAL            'I'  /* since last backup */
 #define L_DIFFERENTIAL           'D'  /* since last full backup */
 #define L_SINCE                  'S'
 #define L_VERIFY_CATALOG         'C'  /* verify from catalog */
 #define L_VERIFY_INIT            'V'  /* verify save (init DB) */
-#define L_VERIFY_VOLUME          'O'  /* verify we can read volume */
+#define L_VERIFY_VOLUME_TO_CATALOG 'O'  /* verify Volume to catalog entries */
 #define L_VERIFY_DATA            'A'  /* verify data on volume */
 
 
-/* Job Types */
-#define JT_BACKUP                'B'
-#define JT_VERIFY                'V'
-#define JT_RESTORE               'R'
+/* Job Types. These are stored in the DB */
+#define JT_BACKUP                'B'  /* Backup Job */
+#define JT_VERIFY                'V'  /* Verify Job */
+#define JT_RESTORE               'R'  /* Restore Job */
 #define JT_CONSOLE               'C'  /* console program */
 #define JT_ADMIN                 'D'  /* admin job */
 #define JT_ARCHIVE               'A'
 
-/* Job Status */
-#define JS_Created               'C'
-#define JS_Running               'R'
-#define JS_Blocked               'B'
+/* Job Status. Some of these are stored in the DB */
+#define JS_Created               'C'  /* created but not yet running */
+#define JS_Running               'R'  /* running */
+#define JS_Blocked               'B'  /* blocked */
 #define JS_Terminated            'T'  /* terminated normally */
 #define JS_ErrorTerminated       'E'  /* Job terminated in error */
 #define JS_Error                 'e'  /* Non-fatal error */
@@ -68,7 +68,9 @@
 #define JS_WaitMount             'M'  /* waiting for Mount */
 
 #define job_cancelled(jcr) \
-  (jcr->JobStatus == JS_Cancelled || jcr->JobStatus == JS_ErrorTerminated)
+  (jcr->JobStatus == JS_Cancelled || \
+   jcr->JobStatus == JS_ErrorTerminated || \
+   jcr->JobStatus == JS_FatalError)
 
 typedef void (JCR_free_HANDLER)(struct s_jcr *jcr);
 
@@ -132,7 +134,7 @@ struct s_jcr {
    uint32_t FileIndex;                /* Last FileIndex processed */
    POOLMEM *fname;                    /* name to put into catalog */
    int fn_printed;                    /* printed filename */
-   char *stime;                       /* start time for incremental/differential */
+   POOLMEM *stime;                    /* start time for incremental/differential */
    JOB_DBR jr;                        /* Job record in Database */
    int RestoreJobId;                  /* Id specified by UA */
    char *RestoreWhere;                /* Where to restore the files */
index 62c6f4eec8da1ac9dd03743df7c7e236511a45e4..f053806ffc20f387d6f83a7e53f2237d9771e6ce 100644 (file)
@@ -97,7 +97,7 @@ Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
          && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
 smtp:  smtp.o
-       $(CXX) $(LDFLAGS) -L. -o $@ smtp.o $(LIBS) $(DLIB) -lbac -lm
+       $(CXX) $(LDFLAGS) -static -L. -o $@ smtp.o $(LIBS) $(DLIB) -lbac -lm
 
 rwlock_test:  rwlock.o
        rm -f rwlock.o
index adec5062a9b4340d75dc2d8918bc4e6a6cf38944..8a9e398b403e62b58bcec5391d1d4b3822147a4d 100644 (file)
@@ -407,6 +407,8 @@ bnet_connect(void *jcr, int retry_interval, int max_retry_time, char *name,
    BSOCK *bsock;
 
    for (i=0; (bsock = bnet_open(name, host, service, port)) == NULL; i -= retry_interval) {
+     Dmsg4(100, "Unable to connect to %s on %s:%d. ERR=%s\n",
+             name, host, port, strerror(errno));
       if (i <= 0) {
         i = 60 * 5;                  /* complain again in 5 minutes */
         if (verbose)
@@ -416,8 +418,8 @@ Retrying ...\n", name, host, port, strerror(errno));
       sleep(retry_interval);
       max_retry_time -= retry_interval;
       if (max_retry_time <= 0) {
-         Jmsg(jcr, M_FATAL, 0, "Unable to connect to %s on %s:%d.\n", 
-             name, host, port);
+         Jmsg(jcr, M_FATAL, 0, _("Unable to connect to %s on %s:%d. ERR=%s\n"),
+             name, host, port, strerror(errno));
         return NULL;
       }
    }
diff --git a/bacula/src/lib/bnet_pkt.c b/bacula/src/lib/bnet_pkt.c
new file mode 100644 (file)
index 0000000..fb5ae14
--- /dev/null
@@ -0,0 +1,88 @@
+/*
+ * Network Packet Utility Routines
+ *
+ *  by Kern Sibbald, July MMII
+ *
+ *
+ *   Version $Id$
+ */
+/*
+   Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
+
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2 of
+   the License, or (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public
+   License along with this program; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+   MA 02111-1307, USA.
+
+ */
+
+
+#include "bacula.h"
+
+/* 
+ * Receive a message from the other end. Each message consists of
+ * two packets. The first is a header that contains the size
+ * of the data that follows in the second packet.
+ * Returns number of bytes read
+ * Returns 0 on end of file
+ * Returns -1 on hard end of file (i.e. network connection close)
+ * Returns -2 on error
+ */
+int32_t 
+bnet_recv_pkt(BSOCK *bsock, BPKT *pkt)
+{
+}
+
+/*
+ * Send a message over the network. The send consists of
+ * two network packets. The first is sends a 32 bit integer containing
+ * the length of the data packet which follows.
+ *
+ * Returns: 0 on failure
+ *         1 on success
+ */
+int
+bnet_send_pkt(BSOCK *bsock, BPKT *pkt)
+{
+   ser_declare;
+
+   ser_begin(bsock->msg, 0);
+
+   while (pkt->type != BP_EOF) {
+      ser_int8(pkt->type);
+      switch (pkt->type) {
+      case BP_CHAR:
+        ser_int8(*((int8_t)pkt->value)));
+        break;
+      case BP_INT32:
+        ser_int32(*(int32_t)pkt->value)));
+        break;
+      case BP_UINT32:
+        break;
+      case BP_INT64:
+        break;
+      case BP_STRING:
+        break;
+      case BP_NAME:
+        break;
+      case BP_BYTES:
+        break;
+      case BP_FLOAT32:
+        break;
+      case BP_FLOAT64:
+        break;
+      default:
+         Emsg1(M_ABORT, 0, _("Unknown BPKT type: %d\n"), pkt->type);
+      }
+
+}
index 92b9ded4602b294ebd54ef0af1f3f857f57cd237..cbb79513eff487b54966cd1bd6b894b11010c3a8 100644 (file)
@@ -66,3 +66,37 @@ typedef struct s_bsock {
 
 #define BNET_SETBUF_READ  1           /* Arg for bnet_set_buffer_size */
 #define BNET_SETBUF_WRITE 2           /* Arg for bnet_set_buffer_size */
+
+/*
+ * This is the structure of the in memory BPKT
+ */
+typedef struct s_bpkt {
+   char *id;                          /* String identifier or name of field */
+   uint8_t type;                      /* field type */
+   uint32_t len;                      /* field length for string, name, bytes */
+   void *value;                       /* pointer to value */
+} BPKT;
+
+/*  
+ * These are the data types that can be sent.
+ * For all values other than string, the storage space
+ *  is assumed to be allocated in the receiving packet.
+ *  For BP_STRING if the *value is non-zero, it is a        
+ *  pointer to a POOLMEM buffer, and the Memory Pool
+ *  routines will be used to assure that the length is
+ *  adequate. NOTE!!! This pointer will be changed
+ *  if the memory is reallocated (sort of like Mmsg(&pool)
+ *  does). If the pointer is NULL, a POOLMEM
+ *  buffer will be allocated.
+ */
+#define BP_EOF       0                /* end of file */
+#define BP_CHAR      1                /* Character */
+#define BP_INT32     1                /* 32 bit integer */
+#define BP_UINT32    3                /* Unsigned 32 bit integer */
+#define BP_INT64     4                /* 64 bit integer */
+#define BP_STRING    5                /* string */
+#define BP_NAME      6                /* Name string -- limited length */
+#define BP_BYTES     7                /* Binary bytes */
+#define BP_FLOAT32   8                /* 32 bit floating point */
+#define BP_FLOAT64   9                /* 64 bit floating point */
+
index d2c17c873c4acc979a3175189c62c46479bfd03d..177aadb7996d03566dbf3c1167abf3a8ad7a8752 100755 (executable)
@@ -381,8 +381,8 @@ static char *job_level_to_str(int level)
    case L_VERIFY_INIT:
       str = "verify init";
       break;
-   case L_VERIFY_VOLUME:
-      str = "verify volume";
+   case L_VERIFY_VOLUME_TO_CATALOG:
+      str = "verify volume to catalog";
       break;
    case L_VERIFY_DATA:
       str = "verify data";
@@ -793,8 +793,6 @@ d_msg(char *file, int line, int level, char *fmt,...)
        level = -level;
     }
 
-/*  printf("level=%d debug=%d fmt=%s\n", level, debug_level, fmt); */
-
     if (level <= debug_level) {
 #ifdef FULL_LOCATION
        if (details) {
@@ -892,7 +890,6 @@ Jmsg(void *vjcr, int type, int level, char *fmt,...)
     va_list   arg_ptr;
     int i, len;
     JCR *jcr = (JCR *) vjcr;
-    int typesave = type;
     MSGS *msgs;
     char *job;
 
@@ -953,7 +950,6 @@ Jmsg(void *vjcr, int type, int level, char *fmt,...)
     len = bvsnprintf(buf+i, sizeof(rbuf)-i, fmt, arg_ptr);
     va_end(arg_ptr);
 
-    ASSERT(typesave==type);          /* type trashed, compiler bug???? */
     dispatch_message(jcr, type, level, rbuf);
 
     Dmsg3(500, "i=%d sizeof(rbuf)-i=%d len=%d\n", i, sizeof(rbuf)-i, len);
index e4d43a9747c823d23734a1acab30702b15805ee8..4d9bd0f49acd725c6e4f3eb806aa2e7fdfafa0f7 100755 (executable)
@@ -130,7 +130,6 @@ static void prtmsg(void *sock, char *fmt, ...)
    va_end(arg_ptr);
 }
 
-#ifdef DEBUG
 char *res_to_str(int rcode)
 {
    if (rcode < r_first || rcode > r_last) {
@@ -139,7 +138,6 @@ char *res_to_str(int rcode)
       return resources[rcode-r_first].name;
    }
 }
-#endif /* DEBUG */
 
 
 /* 
index 35a78771dc92d41f4f9ca2d6b99d7516cd35d307..5316bf08f17658c9e69dd2c788a067dee43706c5 100644 (file)
@@ -105,11 +105,10 @@ int do_append_data(JCR *jcr)
       char info[100];
 
       /* Read Stream header from the File daemon.
-       *  The stream header consists of the
-       *
-       *   file_index (sequential Bacula file index)
-       *   stream     (arbitrary Bacula number to distinguish parts of data)
-       *   info       (Info for Storage daemon -- compressed, encryped, ...)
+       *  The stream header consists of the following:
+       *    file_index (sequential Bacula file index)
+       *    stream     (arbitrary Bacula number to distinguish parts of data)
+       *    info       (Info for Storage daemon -- compressed, encryped, ...)
        */
       if ((n=bget_msg(ds)) < 0) { 
          Jmsg1(jcr, M_FATAL, 0, _("Error reading data header from FD. ERR=%s\n"),
@@ -117,7 +116,7 @@ int do_append_data(JCR *jcr)
         ok = FALSE;
         break;
       }
-      if (n == 0) {                  /* End of conversation */
+      if (n == 0 || job_cancelled(jcr)) {
         break;                       /* all done */
       }
       sm_check(__FILE__, __LINE__, False);
@@ -148,7 +147,6 @@ int do_append_data(JCR *jcr)
        */
       sm_check(__FILE__, __LINE__, False);
       while ((n=bget_msg(ds)) > 0 && !job_cancelled(jcr)) {
-        char *dsmsg = ds->msg;
 
         sm_check(__FILE__, __LINE__, False);
         rec.VolSessionId = jcr->VolSessionId;
@@ -189,8 +187,6 @@ int do_append_data(JCR *jcr)
               break;
            }
         }
-        ASSERT(dsmsg == ds->msg);
-        ASSERT(dsmsg == rec.data);
         sm_check(__FILE__, __LINE__, False);
       }
       if (n < 0) {
@@ -216,13 +212,13 @@ int do_append_data(JCR *jcr)
    }
    /* Write out final block of this session */
    if (!write_block_to_device(jcr, dev, block)) {
-      Dmsg0(0, "Set ok=FALSE after write_block_to_device.\n");
+      Pmsg0(0, "Set ok=FALSE after write_block_to_device.\n");
       ok = FALSE;
    }
 
    /* Release the device */
    if (!release_device(jcr, dev, block)) {
-      Dmsg0(0, "Error in release_device\n");
+      Pmsg0(0, "Error in release_device\n");
       ok = FALSE;
    }
 
index 698c9e18aa1b983b63a07d73f01ecf478ccf74be..2d88d1e367d49db4892ae3adbec5ecac740711be 100644 (file)
@@ -37,7 +37,7 @@ static char Update_media[] = "CatReq Job=%s UpdateMedia VolName=%s\
  VolJobs=%d VolFiles=%d VolBlocks=%d VolBytes=%" lld " VolMounts=%d\
  VolErrors=%d VolWrites=%d VolMaxBytes=%" lld " EndTime=%d VolStatus=%s\
  FirstIndex=%d LastIndex=%d StartFile=%d EndFile=%d \
- StartBlock=%d EndBlock=%d relabel=%d\n";
+ StartBlock=%d EndBlock=%d relabel=%d Slot=%d\n";
 
 static char FileAttributes[] = "UpdCat Job=%s FileAttributes ";
 
@@ -47,7 +47,8 @@ static char Job_status[]   = "3012 Job %s jobstatus %d\n";
 /* Responses received from the Director */
 static char OK_media[] = "1000 OK VolName=%127s VolJobs=%d VolFiles=%d\
  VolBlocks=%d VolBytes=%" lld " VolMounts=%d VolErrors=%d VolWrites=%d\
- VolMaxBytes=%" lld " VolCapacityBytes=%" lld " VolStatus=%20s\n";
+ VolMaxBytes=%" lld " VolCapacityBytes=%" lld " VolStatus=%20s\
+ Slot=%d\n";
 
 static char OK_update[] = "1000 OK UpdateMedia\n";
 
@@ -81,7 +82,8 @@ static int do_request_volume_info(JCR *jcr)
               &vol->VolCatBlocks, &vol->VolCatBytes, 
               &vol->VolCatMounts, &vol->VolCatErrors,
               &vol->VolCatWrites, &vol->VolCatMaxBytes, 
-              &vol->VolCatCapacityBytes, vol->VolCatStatus) != 11) {
+              &vol->VolCatCapacityBytes, vol->VolCatStatus,
+              &vol->Slot) != 12) {
        Dmsg1(30, "Bad response from Dir: %s\n", dir->msg);
        return 0;
     }
@@ -145,6 +147,7 @@ int dir_update_volume_info(JCR *jcr, VOLUME_CAT_INFO *vol, int relabel)
 
    if (vol->VolCatName[0] == 0) {
       Jmsg0(jcr, M_ERROR, 0, _("NULL Volume name. This shouldn't happen!!!\n"));
+      return 0;
    }
    bnet_fsend(dir, Update_media, jcr->Job, 
       vol->VolCatName, vol->VolCatJobs, vol->VolCatFiles,
@@ -155,7 +158,7 @@ int dir_update_volume_info(JCR *jcr, VOLUME_CAT_INFO *vol, int relabel)
       jcr->VolFirstFile, jcr->JobFiles,
       jcr->start_file, jcr->end_file,
       jcr->start_block, jcr->end_block,
-      relabel);
+      relabel, vol->Slot);
    Dmsg1(20, "update_volume_data(): %s", dir->msg);
    if (bnet_recv(dir) <= 0) {
       Dmsg0(90, "updateVolCatInfo error bnet_recv\n");
@@ -179,7 +182,7 @@ int dir_update_file_attributes(JCR *jcr, DEV_RECORD *rec)
    ser_declare;
 
    dir->msglen = sprintf(dir->msg, FileAttributes, jcr->Job);
-   dir->msg = (char *) check_pool_memory_size(dir->msg, dir->msglen + 
+   dir->msg = check_pool_memory_size(dir->msg, dir->msglen + 
                sizeof(DEV_RECORD) + rec->data_len);
    ser_begin(dir->msg + dir->msglen, 0);
    ser_uint32(rec->VolSessionId);
@@ -254,8 +257,9 @@ int dir_ask_sysop_to_mount_next_volume(JCR *jcr, DEVICE *dev)
                jcr->VolumeName, jcr->dev_name, jcr->Job);
       } else {
         jstat = JS_WaitMedia;
-         Jmsg(jcr, M_MOUNT, 0, _("Job %s waiting. Cannot find any appendable volumes.\n\
-Please use the \"unmount\" and \"label\"  commands to create new Volumes for:\n\
+        Jmsg(jcr, M_MOUNT, 0, _(
+"Job %s waiting. Cannot find any appendable volumes.\n\
+Please use the \"label\"  command to create new Volumes for:\n\
    Storage Device \"%s\" with Pool \"%s\" and Media type \"%s\".\n\
 Use \"mount\" to resume the job.\n"),
              jcr->Job, jcr->dev_name, jcr->pool_name, jcr->media_type);
@@ -300,7 +304,7 @@ Use \"mount\" to resume the job.\n"),
         if (num_wait >= max_num_wait) {
             Mmsg(&dev->errmsg, _("Gave up waiting to mount Storage Device \"%s\" for Job %s\n"), 
                 jcr->dev_name, jcr->Job);
-            Jmsg(jcr, M_ERROR, 0, "%s", dev->errmsg);
+            Jmsg(jcr, M_FATAL, 0, "%s", dev->errmsg);
             Dmsg1(90, "Gave up waiting on device %s\n", dev->dev_name);
            return 0;                 /* exceeded maximum waits */
         }
@@ -309,7 +313,7 @@ Use \"mount\" to resume the job.\n"),
       if (stat == EINVAL) {
          Mmsg2(&dev->errmsg, _("pthread error in mount_next_volume stat=%d ERR=%s\n"),
               stat, strerror(stat));
-         Jmsg(jcr, M_ERROR, 0, "%s", dev->errmsg);
+         Jmsg(jcr, M_FATAL, 0, "%s", dev->errmsg);
         return 0;
       }
       if (stat != 0) {
@@ -325,7 +329,7 @@ Use \"mount\" to resume the job.\n"),
       if (jcr->VolumeName[0] == 0 && 
          !dir_find_next_appendable_volume(jcr)) {
         Jmsg(jcr, M_MOUNT, 0, _(
-"You woke me up, but I cannot find any appendable\n\
+"Someone woke me up, but I cannot find any appendable\n\
 volumes for Job=%s.\n"), jcr->Job);
         continue;
       }       
@@ -422,7 +426,7 @@ int dir_ask_sysop_to_mount_volume(JCR *jcr, DEVICE *dev)
         if (num_wait >= max_num_wait) {
             Mmsg(&dev->errmsg, _("Gave up waiting to mount Storage Device \"%s\" for Job %s\n"), 
                 jcr->dev_name, jcr->Job);
-            Jmsg(jcr, M_ERROR, 0, "%s", dev->errmsg);
+            Jmsg(jcr, M_FATAL, 0, "%s", dev->errmsg);
             Dmsg1(90, "Gave up waiting on device %s\n", dev->dev_name);
            return 0;                 /* exceeded maximum waits */
         }
@@ -431,7 +435,7 @@ int dir_ask_sysop_to_mount_volume(JCR *jcr, DEVICE *dev)
       if (stat == EINVAL) {
          Mmsg2(&dev->errmsg, _("pthread error in mount_volume stat=%d ERR=%s\n"),
               stat, strerror(stat));
-         Jmsg(jcr, M_ERROR, 0, "%s", dev->errmsg);
+         Jmsg(jcr, M_FATAL, 0, "%s", dev->errmsg);
         return 0;
       }
       if (stat != 0) {
index 418a6e6c230221022a180dc5415bf29396a2321e..d6a4e5d907f62ab1175009c353dfef9c35343be9 100644 (file)
@@ -91,7 +91,7 @@ int main (int argc, char *argv[])
 
          case 'e':                    /* exclude list */
             if ((fd = fopen(optarg, "r")) == NULL) {
-               Dmsg2(0, "Could not open exclude file: %s, ERR=%s\n",
+               Pmsg2(0, "Could not open exclude file: %s, ERR=%s\n",
                  optarg, strerror(errno));
               exit(1);
            }
@@ -105,7 +105,7 @@ int main (int argc, char *argv[])
 
          case 'i':                    /* include list */
             if ((fd = fopen(optarg, "r")) == NULL) {
-               Dmsg2(0, "Could not open include file: %s, ERR=%s\n",
+               Pmsg2(0, "Could not open include file: %s, ERR=%s\n",
                  optarg, strerror(errno));
               exit(1);
            }
@@ -128,7 +128,7 @@ int main (int argc, char *argv[])
    argv += optind;
 
    if (argc != 2) {
-      Dmsg0(0, "Wrong number of arguments: \n");
+      Pmsg0(0, "Wrong number of arguments: \n");
       usage();
    }
    if (!got_inc) {                           /* If no include file, */
@@ -270,7 +270,7 @@ static void do_extract(char *devname, char *where)
         if (dev->state & ST_EOF) {
            continue;                 /* try again */
         }
-         Dmsg0(0, "Read Record got a bad record\n");
+         Pmsg0(0, "Read Record got a bad record\n");
         status_dev(dev, &status);
          Dmsg1(20, "Device status: %x\n", status);
         if (status & MT_EOD)
@@ -430,7 +430,7 @@ static void do_extract(char *devname, char *where)
            } else {
               strcat(ofile, fname);
            }
-/*          Dmsg1(000, "Restoring: %s\n", ofile); */
+/*          Pmsg1(000, "Restoring: %s\n", ofile); */
 
            extract = create_file(jcr, fname, ofile, lname, type, &statp, &ofd);
 
@@ -462,7 +462,7 @@ static void do_extract(char *devname, char *where)
 
             Dmsg2(100, "Write uncompressed %d bytes, total before write=%d\n", compress_len, total);
            if ((uLongf)write(ofd, compress_buf, (size_t)compress_len) != compress_len) {
-               Dmsg0(0, "===Write error===\n");
+               Pmsg0(0, "===Write error===\n");
                Emsg2(M_ERROR_TERM, 0, "Write error on %s: %s\n", ofile, strerror(errno));
            }
            total += compress_len;
@@ -486,7 +486,7 @@ static void do_extract(char *devname, char *where)
         extract = FALSE;
         set_statp(jcr, fname, ofile, lname, type, &statp);
       } else if (rec.Stream != STREAM_MD5_SIGNATURE) {
-         Dmsg2(0, "None of above!!! stream=%d data=%s\n", rec.Stream, rec.data);
+         Pmsg2(0, "None of above!!! stream=%d data=%s\n", rec.Stream, rec.data);
       }
    }
 
index 5224a86e9df63a103d268d402296732602f4442e..26bd627065d4fa2d7ef74d054b0722540c9ee8d8 100644 (file)
@@ -96,7 +96,7 @@ int main (int argc, char *argv[])
 
          case 'e':                    /* exclude list */
             if ((fd = fopen(optarg, "r")) == NULL) {
-               Dmsg2(0, "Could not open exclude file: %s, ERR=%s\n",
+               Pmsg2(0, "Could not open exclude file: %s, ERR=%s\n",
                  optarg, strerror(errno));
               exit(1);
            }
@@ -110,7 +110,7 @@ int main (int argc, char *argv[])
 
          case 'i':                    /* include list */
             if ((fd = fopen(optarg, "r")) == NULL) {
-               Dmsg2(0, "Could not open include file: %s, ERR=%s\n",
+               Pmsg2(0, "Could not open include file: %s, ERR=%s\n",
                  optarg, strerror(errno));
               exit(1);
            }
@@ -148,7 +148,7 @@ int main (int argc, char *argv[])
    argv += optind;
 
    if (!argc && !default_tape) {
-      Dmsg0(0, "No archive name specified\n");
+      Pmsg0(0, "No archive name specified\n");
       usage();
    }
 
@@ -305,7 +305,7 @@ static void do_blocks(char *infname)
     * If on second or subsequent volume, adjust buffer pointer 
     */
    if (dev->VolHdr.PrevVolName[0] != 0) { /* second volume */
-      Dmsg1(0, "\n\
+      Pmsg1(0, "\n\
 Warning, this Volume is a continuation of Volume %s\n",
                dev->VolHdr.PrevVolName);
    }
@@ -347,7 +347,7 @@ static void do_jobs(char *infname)
     * If on second or subsequent volume, adjust buffer pointer 
     */
    if (dev->VolHdr.PrevVolName[0] != 0) { /* second volume */
-      Dmsg1(0, "\n\
+      Pmsg1(0, "\n\
 Warning, this Volume is a continuation of Volume %s\n",
                dev->VolHdr.PrevVolName);
    }
@@ -418,7 +418,7 @@ static void do_ls(char *infname)
     * If on second or subsequent volume, adjust buffer pointer 
     */
    if (dev->VolHdr.PrevVolName[0] != 0) { /* second volume */
-      Dmsg1(0, "\n\
+      Pmsg1(0, "\n\
 Warning, this Volume is a continuation of Volume %s\n",
                dev->VolHdr.PrevVolName);
    }
index c8f26b3a34e736673dac37adef6eadf01e9da20d..6b9bcf45eb23d26980f9144619157c657bb34eac 100644 (file)
@@ -82,7 +82,7 @@ int main (int argc, char *argv[])
    argv += optind;
 
    if (argc != 1) {
-      Dmsg0(0, "Wrong number of arguments: \n");
+      Pmsg0(0, "Wrong number of arguments: \n");
       usage();
    }
 
@@ -170,7 +170,7 @@ static void do_scan(char *devname)
         if (dev->state & ST_EOF) {
            continue;                 /* try again */
         }
-         Dmsg0(0, "Read Record got a bad record\n");
+         Pmsg0(0, "Read Record got a bad record\n");
         status_dev(dev, &status);
          Dmsg1(20, "Device status: %x\n", status);
         if (status & MT_EOD)
@@ -206,56 +206,56 @@ static void do_scan(char *devname)
         }
         switch (rec.FileIndex) {
            case PRE_LABEL:
-               Dmsg0(000, "Volume is prelabeled. This tape cannot be scanned.\n");
+               Pmsg0(000, "Volume is prelabeled. This tape cannot be scanned.\n");
               return;
               break;
            case VOL_LABEL:
               unser_volume_label(dev, &rec);
               strcpy(mr.VolumeName, dev->VolHdr.VolName);
               if (!db_get_media_record(db, &mr)) {
-                  Dmsg1(000, "VOL_LABEL: Media record not found for Volume: %s\n",
+                  Pmsg1(000, "VOL_LABEL: Media record not found for Volume: %s\n",
                     mr.VolumeName);
                  continue;
               }
               if (strcmp(mr.MediaType, dev->VolHdr.MediaType) != 0) {
-                  Dmsg2(000, "VOL_LABEL: MediaType mismatch. DB=%s Vol=%s\n",
+                  Pmsg2(000, "VOL_LABEL: MediaType mismatch. DB=%s Vol=%s\n",
                     mr.MediaType, dev->VolHdr.MediaType);
                  continue;
               }
               strcpy(pr.Name, dev->VolHdr.PoolName);
               if (!db_get_pool_record(db, &pr)) {
-                  Dmsg1(000, "VOL_LABEL: Pool record not found for Pool: %s\n",
+                  Pmsg1(000, "VOL_LABEL: Pool record not found for Pool: %s\n",
                     pr.Name);
                  continue;
               }
               if (strcmp(pr.PoolType, dev->VolHdr.PoolType) != 0) {
-                  Dmsg2(000, "VOL_LABEL: PoolType mismatch. DB=%s Vol=%s\n",
+                  Pmsg2(000, "VOL_LABEL: PoolType mismatch. DB=%s Vol=%s\n",
                     pr.PoolType, dev->VolHdr.PoolType);
                  continue;
               }
-               Dmsg1(000, "VOL_LABEL: OK for Volume: %s\n", mr.VolumeName);
+               Pmsg1(000, "VOL_LABEL: OK for Volume: %s\n", mr.VolumeName);
               break;
            case SOS_LABEL:
               unser_session_label(&label, &rec);
               memset(&jr, 0, sizeof(jr));
               jr.JobId = label.JobId;
               if (!db_get_job_record(db, &jr)) {
-                  Dmsg1(000, "SOS_LABEL: Job record not found for JobId: %d\n",
+                  Pmsg1(000, "SOS_LABEL: Job record not found for JobId: %d\n",
                     jr.JobId);
                  continue;
               }
               if (rec.VolSessionId != jr.VolSessionId) {
-                  Dmsg2(000, "SOS_LABEL: VolSessId mismatch. DB=%d Vol=%d\n",
+                  Pmsg2(000, "SOS_LABEL: VolSessId mismatch. DB=%d Vol=%d\n",
                     jr.VolSessionId, rec.VolSessionId);
                  continue;
               }
               if (rec.VolSessionTime != jr.VolSessionTime) {
-                  Dmsg2(000, "SOS_LABEL: VolSessTime mismatch. DB=%d Vol=%d\n",
+                  Pmsg2(000, "SOS_LABEL: VolSessTime mismatch. DB=%d Vol=%d\n",
                     jr.VolSessionTime, rec.VolSessionTime);
                  continue;
               }
               if (jr.PoolId != pr.PoolId) {
-                  Dmsg2(000, "SOS_LABEL: PoolId mismatch. DB=%d Vol=%d\n",
+                  Pmsg2(000, "SOS_LABEL: PoolId mismatch. DB=%d Vol=%d\n",
                     jr.PoolId, pr.PoolId);
                  continue;
               }
@@ -263,21 +263,21 @@ static void do_scan(char *devname)
            case EOS_LABEL:
               unser_session_label(&elabel, &rec);
               if (elabel.JobId != label.JobId) {
-                  Dmsg2(000, "EOS_LABEL: Start/End JobId mismatch. Start=%d End=%d\n",
+                  Pmsg2(000, "EOS_LABEL: Start/End JobId mismatch. Start=%d End=%d\n",
                     label.JobId, elabel.JobId);
                  continue;
               }
               if (elabel.JobFiles != jr.JobFiles) {
-                  Dmsg2(000, "EOS_LABEL: JobFiles mismatch. DB=%d EOS=%d\n",
+                  Pmsg2(000, "EOS_LABEL: JobFiles mismatch. DB=%d EOS=%d\n",
                     jr.JobFiles, elabel.JobFiles);
                  continue;
               }                                 
               if (elabel.JobBytes != jr.JobBytes) {
-                  Dmsg2(000, "EOS_LABEL: JobBytes mismatch. DB=%d EOS=%d\n",
+                  Pmsg2(000, "EOS_LABEL: JobBytes mismatch. DB=%d EOS=%d\n",
                     jr.JobBytes, elabel.JobBytes);
                  continue;
               }                                 
-               Dmsg1(000, "EOS_LABEL: OK for JobId=%d\n", elabel.JobId);
+               Pmsg1(000, "EOS_LABEL: OK for JobId=%d\n", elabel.JobId);
               break;
            case EOM_LABEL:
               break;
@@ -340,7 +340,7 @@ static void do_scan(char *devname)
       } else if (rec.Stream == STREAM_FILE_DATA) {
 
       } else if (rec.Stream != STREAM_MD5_SIGNATURE) {
-         Dmsg2(0, "None of above!!! stream=%d data=%s\n", rec.Stream, rec.data);
+         Pmsg2(0, "None of above!!! stream=%d data=%s\n", rec.Stream, rec.data);
       }
    }
 
index 98228c906f319fff2a7366654080efa017947fa0..6154d79851c34b74cf5c049ee8079e4d91c4e634 100644 (file)
 struct s_vol_list {
    struct s_vol_list *next;
    char VolumeName[MAX_NAME_LENGTH];
+   int Slot; 
 };
 typedef struct s_vol_list VOL_LIST;
 
 
 /*
  * !!!!!!!!!!!!!!!!!! NOTE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- * !!!                                              !!!
- * !!!  All records must have a pointer to          !!!
- * !!!  the next item as the first item defined.    !!!
- * !!!                                              !!!
+ * !!!                                               !!!
+ * !!!   All records must have a pointer to          !!!
+ * !!!   the next item as the first item defined.    !!!
+ * !!!                                               !!!
  * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  */
 
@@ -72,15 +73,15 @@ typedef struct s_bsr_sesstime {
 
 typedef struct s_bsr_volfile {
    struct s_bsr_volfile *next;
-   uint32_t sfile;                   /* start file */
-   uint32_t efile;                   /* end file */
+   uint32_t sfile;                    /* start file */
+   uint32_t efile;                    /* end file */
    int found;
 } BSR_VOLFILE;
 
 typedef struct s_bsr_findex {
    struct s_bsr_findex *next;
-   int32_t findex;                   /* start file index */
-   int32_t findex2;                  /* end file index */
+   int32_t findex;                    /* start file index */
+   int32_t findex2;                   /* end file index */
    int found;
 } BSR_FINDEX;
 
@@ -107,21 +108,28 @@ typedef struct s_bsr_job {
    int found;
 } BSR_JOB;
 
+typedef struct s_bsr_stream {
+   struct s_bsr_stream *next;
+   int32_t stream;                    /* stream desired */
+   int found;
+} BSR_STREAM;
 
 typedef struct s_bsr {
-   struct s_bsr *next;               /* pointer to next one */
-   int          done;                /* set when everything found */
-   char        *VolumeName;
-   BSR_VOLFILE *volfile;
+   struct s_bsr *next;                /* pointer to next one */
+   int           done;                /* set when everything found */
+   char         *VolumeName;
+   int32_t       Slot;                /* Slot */
+   BSR_VOLFILE  *volfile;
    BSR_SESSTIME *sesstime;
-   BSR_SESSID  *sessid;
-   BSR_JOBID   *JobId;
-   BSR_JOB     *job;
-   BSR_CLIENT  *client;
-   BSR_FINDEX  *FileIndex;
-   BSR_JOBTYPE *JobType;
+   BSR_SESSID   *sessid;
+   BSR_JOBID    *JobId;
+   BSR_JOB      *job;
+   BSR_CLIENT   *client;
+   BSR_FINDEX   *FileIndex;
+   BSR_JOBTYPE  *JobType;
    BSR_JOBLEVEL *JobLevel;
-   FF_PKT *ff;                       /* include/exclude */
+   BSR_STREAM   *stream;
+// FF_PKT *ff;                        /* include/exclude */
 } BSR;
 
 
index 53cd5f8aa4dfdd60930f5772c925bd4afff7cf19..72a08ca96efcb3516134544cfcce0087c6f281da 100644 (file)
@@ -182,7 +182,7 @@ int main(int argc, char *argv[])
         exit(1);
       }
       if (!open_device(dev)) {
-         Dmsg1(0, "Warning could not open device. ERR=%s", strerror_dev(dev));
+         Pmsg1(0, "Warning could not open device. ERR=%s", strerror_dev(dev));
         term_dev(dev);
         dev = NULL;
       }
@@ -251,10 +251,10 @@ static void devicecmd()
         return;
       }
       if (!open_device(dev)) {
-         Dmsg1(0, "Device open failed. ERR=%s\n", strerror_dev(dev));
+         Pmsg1(0, "Device open failed. ERR=%s\n", strerror_dev(dev));
       }
    } else {
-      Dmsg0(0, "Device init failed.\n");                          
+      Pmsg0(0, "Device init failed.\n");                          
    }
 }
 
@@ -267,7 +267,7 @@ static void labelcmd()
    int found = 0;
 
    if (!dev) {
-      Dmsg0(0, "No device: Use device command.\n");
+      Pmsg0(0, "No device: Use device command.\n");
       return;
    }
 
@@ -283,7 +283,7 @@ static void labelcmd()
    } 
    UnlockRes();
    if (!found) {
-      Dmsg2(0, "Could not find device %s in %s\n", dev->dev_name, configfile);
+      Pmsg2(0, "Could not find device %s in %s\n", dev->dev_name, configfile);
       return;
    }
 
@@ -293,7 +293,7 @@ static void labelcmd()
         
    if (!(dev->state & ST_OPENED)) {
       if (!open_device(dev)) {
-         Dmsg1(0, "Device open failed. ERR=%s\n", strerror_dev(dev));
+         Pmsg1(0, "Device open failed. ERR=%s\n", strerror_dev(dev));
       }
    }
    write_volume_label_to_dev(jcr, device, cmd, "Default");
@@ -309,35 +309,35 @@ static void readlabelcmd()
    DEV_BLOCK *block;
 
    if (!dev) {
-      Dmsg0(0, "No device: Use device command.\n");
+      Pmsg0(0, "No device: Use device command.\n");
       return;
    }
    block = new_block(dev);
    stat = read_dev_volume_label(jcr, dev, block);
    switch (stat) {
       case VOL_NO_LABEL:
-         Dmsg0(0, "Volume has no label.\n");
+         Pmsg0(0, "Volume has no label.\n");
         break;
       case VOL_OK:
-         Dmsg0(0, "Volume label read correctly.\n");
+         Pmsg0(0, "Volume label read correctly.\n");
         break;
       case VOL_IO_ERROR:
-         Dmsg1(0, "I/O error on device: ERR=%s", strerror_dev(dev));
+         Pmsg1(0, "I/O error on device: ERR=%s", strerror_dev(dev));
         break;
       case VOL_NAME_ERROR:
-         Dmsg0(0, "Volume name error\n");
+         Pmsg0(0, "Volume name error\n");
         break;
       case VOL_CREATE_ERROR:
-         Dmsg1(0, "Error creating label. ERR=%s", strerror_dev(dev));
+         Pmsg1(0, "Error creating label. ERR=%s", strerror_dev(dev));
         break;
       case VOL_VERSION_ERROR:
-         Dmsg0(0, "Volume version error.\n");
+         Pmsg0(0, "Volume version error.\n");
         break;
       case VOL_LABEL_ERROR:
-         Dmsg0(0, "Bad Volume label type.\n");
+         Pmsg0(0, "Bad Volume label type.\n");
         break;
       default:
-         Dmsg0(0, "Unknown error.\n");
+         Pmsg0(0, "Unknown error.\n");
         break;
    }
 
@@ -370,10 +370,10 @@ static int find_device_res()
    } 
    UnlockRes();
    if (!found) {
-      Dmsg2(0, "Could not find device %s in %s\n", dev->dev_name, configfile);
+      Pmsg2(0, "Could not find device %s in %s\n", dev->dev_name, configfile);
       return 0;
    }
-   Dmsg1(0, "Using device: %s\n", dev->dev_name);
+   Pmsg1(0, "Using device: %s\n", dev->dev_name);
    return 1;
 }
 
@@ -385,13 +385,13 @@ static void loadcmd()
 {
 
    if (!dev) {
-      Dmsg0(0, "No device: Use device command.\n");
+      Pmsg0(0, "No device: Use device command.\n");
       return;
    }
    if (!load_dev(dev)) {
-      Dmsg1(0, "Bad status from load. ERR=%s\n", strerror_dev(dev));
+      Pmsg1(0, "Bad status from load. ERR=%s\n", strerror_dev(dev));
    } else
-      Dmsg1(0, "Loaded %s\n", dev_name(dev));
+      Pmsg1(0, "Loaded %s\n", dev_name(dev));
 }
 
 /*
@@ -400,14 +400,14 @@ static void loadcmd()
 static void rewindcmd()
 {
    if (!dev) {
-      Dmsg0(0, "No device: Use device command.\n");
+      Pmsg0(0, "No device: Use device command.\n");
       return;
    }
    if (!rewind_dev(dev)) {
-      Dmsg1(0, "Bad status from rewind. ERR=%s\n", strerror_dev(dev));
+      Pmsg1(0, "Bad status from rewind. ERR=%s\n", strerror_dev(dev));
       clrerror_dev(dev, -1);
    } else
-      Dmsg1(0, "Rewound %s\n", dev_name(dev));
+      Pmsg1(0, "Rewound %s\n", dev_name(dev));
 }
 
 /*
@@ -416,7 +416,7 @@ static void rewindcmd()
 static void clearcmd()
 {
    if (!dev) {
-      Dmsg0(0, "No device: Use device command.\n");
+      Pmsg0(0, "No device: Use device command.\n");
       return;
    }
    clrerror_dev(dev, -1);
@@ -430,14 +430,14 @@ static void weofcmd()
    int stat;
 
    if (!dev) {
-      Dmsg0(0, "No device: Use device command.\n");
+      Pmsg0(0, "No device: Use device command.\n");
       return;
    }
    if ((stat = weof_dev(dev, 1)) < 0) {
-      Dmsg2(0, "Bad status from weof %d. ERR=%s\n", stat, strerror_dev(dev));
+      Pmsg2(0, "Bad status from weof %d. ERR=%s\n", stat, strerror_dev(dev));
       return;
    } else {
-      Dmsg1(0, "Wrote EOF to %s\n", dev_name(dev));
+      Pmsg1(0, "Wrote EOF to %s\n", dev_name(dev));
    }
 }
 
@@ -451,59 +451,59 @@ static void rawtestcmd()
    int i, j, k;
 
    if (!dev) {
-      Dmsg0(0, "No device: Use device command.\n");
+      Pmsg0(0, "No device: Use device command.\n");
       return;
    }
    if (!rewind_dev(dev)) {
-      Dmsg1(0, "Bad status from rewind. ERR=%s\n", strerror_dev(dev));
+      Pmsg1(0, "Bad status from rewind. ERR=%s\n", strerror_dev(dev));
       return;
    }
-   Dmsg0(0, "Rewound, now writing 100 blocks\n");
+   Pmsg0(0, "Rewound, now writing 100 blocks\n");
    for (i=0; i<100; i++) {
       j = 10000 + i;
       memset(buf, i, j);
       if (!write_dev(dev, buf, j)) {
-         Dmsg1(0, "Bad status from write. ERR=%s\n", strerror_dev(dev));
+         Pmsg1(0, "Bad status from write. ERR=%s\n", strerror_dev(dev));
         return;
       }
-     Dmsg2(10, "Wrote %d bytes of %d\n", j, i);
+     Pmsg2(10, "Wrote %d bytes of %d\n", j, i);
    }
-   Dmsg0(0, "100 Blocks written, flushing buffers and writing EOF\n");
+   Pmsg0(0, "100 Blocks written, flushing buffers and writing EOF\n");
    if (flush_dev(dev) != 0) {
-      Dmsg1(0, "Error writing flushing. ERR=%s\n", strerror(errno));
+      Pmsg1(0, "Error writing flushing. ERR=%s\n", strerror(errno));
       return;
    }
    if (weof_dev(dev, 1) != 0) {
-      Dmsg1(0, "Error writing eof. ERR=%s\n", strerror(errno));
+      Pmsg1(0, "Error writing eof. ERR=%s\n", strerror(errno));
       return;
    }
-   Dmsg0(0, "Rewinding ...\n");
+   Pmsg0(0, "Rewinding ...\n");
    if (!rewind_dev(dev)) {
-      Dmsg1(0, "Bad status from rewind. ERR=%s\n", strerror_dev(dev));
+      Pmsg1(0, "Bad status from rewind. ERR=%s\n", strerror_dev(dev));
       return;
    }
 
 
-   Dmsg0(0, "Read and verify data ...\n");
+   Pmsg0(0, "Read and verify data ...\n");
    for (i=0; i<100; i++) {
       j = 10000 + i;
       if (!read_dev(dev, buf, j)) {
-         Dmsg1(0, "Bad status from read. ERR=%s\n", strerror_dev(dev));
+         Pmsg1(0, "Bad status from read. ERR=%s\n", strerror_dev(dev));
         return;
       }
       for (k=0; k<j; k++) {
         if (buf[k] != i) {
-            Dmsg5(0, "Data read expected %d got %d at byte %d, block %d size %d\n", 
+            Pmsg5(0, "Data read expected %d got %d at byte %d, block %d size %d\n", 
             i, buf[k], k, i, j);
            return;
         }
       }     
       Dmsg3(10, "Successful read block %d of %d bytes of %d\n", i, j, i);   
    }
-   Dmsg0(0, "Read OK!\n");
-   Dmsg0(0, "Rewinding ...\n");
+   Pmsg0(0, "Read OK!\n");
+   Pmsg0(0, "Rewinding ...\n");
    if (!rewind_dev(dev)) {
-      Dmsg1(0, "Bad status from rewind. ERR=%s\n", strerror_dev(dev));
+      Pmsg1(0, "Bad status from rewind. ERR=%s\n", strerror_dev(dev));
       return;
    }
 #else
@@ -520,14 +520,14 @@ static void rawtestcmd()
 static void eomcmd()
 {
    if (!dev) {
-      Dmsg0(0, "No device: Use device command.\n");
+      Pmsg0(0, "No device: Use device command.\n");
       return;
    }
    if (!eod_dev(dev)) {
-      Dmsg1(0, "Bad status from eod. ERR=%s\n", strerror_dev(dev));
+      Pmsg1(0, "Bad status from eod. ERR=%s\n", strerror_dev(dev));
       return;
    } else {
-      Dmsg0(0, "Moved to end of media\n");
+      Pmsg0(0, "Moved to end of media\n");
    }
 }
 
@@ -547,13 +547,13 @@ static void bsfcmd()
 {
    int stat;
    if (!dev) {
-      Dmsg0(0, "No device: Use device command.\n");
+      Pmsg0(0, "No device: Use device command.\n");
       return;
    }
    if ((stat=bsf_dev(dev, 1)) < 0) {
-      Dmsg1(0, "Bad status from bsf. ERR=%s\n", strerror(errno));
+      Pmsg1(0, "Bad status from bsf. ERR=%s\n", strerror(errno));
    } else {
-      Dmsg0(0, "Back spaced one file.\n");
+      Pmsg0(0, "Back spaced one file.\n");
    }
 }
 
@@ -564,13 +564,13 @@ static void bsrcmd()
 {
    int stat;
    if (!dev) {
-      Dmsg0(0, "No device: Use device command.\n");
+      Pmsg0(0, "No device: Use device command.\n");
       return;
    }
    if ((stat=bsr_dev(dev, 1)) < 0) {
-      Dmsg1(0, "Bad status from bsr. ERR=%s\n", strerror(errno));
+      Pmsg1(0, "Bad status from bsr. ERR=%s\n", strerror(errno));
    } else {
-      Dmsg0(0, "Back spaced one record.\n");
+      Pmsg0(0, "Back spaced one record.\n");
    }
 }
 
@@ -581,10 +581,10 @@ static void bsrcmd()
 static void capcmd()
 {
    if (!dev) {
-      Dmsg0(0, "No device: Use device command.\n");
+      Pmsg0(0, "No device: Use device command.\n");
       return;
    }
-   Dmsg0(0, "Device capabilities: ");
+   Pmsg0(0, "Device capabilities: ");
    printf("%sEOF ", dev->capabilities & CAP_EOF ? "" : "!");
    printf("%sBSR ", dev->capabilities & CAP_BSR ? "" : "!");
    printf("%sBSF ", dev->capabilities & CAP_BSF ? "" : "!");
@@ -611,11 +611,11 @@ static void rectestcmd()
    int i, blkno = 0;
 
    if (!dev) {
-      Dmsg0(0, "No device: Use device command.\n");
+      Pmsg0(0, "No device: Use device command.\n");
       return;
    }
 
-   Dmsg0(0, "Test writting larger and larger records.\n\
+   Pmsg0(0, "Test writting larger and larger records.\n\
 This is a torture test for records. \n");
 
    sm_check(__FILE__, __LINE__, False);
@@ -630,7 +630,7 @@ This is a torture test for records. \n");
       while (!write_record_to_block(block, rec)) {
         empty_block(block);
         blkno++;
-         Dmsg2(0, "Block %d i=%d\n", blkno, i);
+         Pmsg2(0, "Block %d i=%d\n", blkno, i);
       }
       sm_check(__FILE__, __LINE__, False);
    }
@@ -646,10 +646,10 @@ This is a torture test for records. \n");
 static void testcmd()
 {
    if (!dev) {
-      Dmsg0(0, "No device: Use device command.\n");
+      Pmsg0(0, "No device: Use device command.\n");
       return;
    }
-   Dmsg0(0, "Append files test.\n\n\
+   Pmsg0(0, "Append files test.\n\n\
 I'm going to write one record  in file 0,\n\
                    two records in file 1,\n\
              and three records in file 2\n\n");
@@ -665,22 +665,22 @@ I'm going to write one record  in file 0,\n\
    weofcmd();    /* end file 2 */
 //   weofcmd();
    rewindcmd();
-   Dmsg0(0, "Now moving to end of media.\n");
+   Pmsg0(0, "Now moving to end of media.\n");
    eodcmd();
-   Dmsg2(0, "\nWe should be in file 3. I am at file %d. This is %s\n\n", 
+   Pmsg2(0, "\nWe should be in file 3. I am at file %d. This is %s\n\n", 
       dev->file, dev->file == 3 ? "correct!" : "NOT correct!!!!");
 
-   Dmsg0(0, "\nNow I am going to attempt to append to the tape.\n");
+   Pmsg0(0, "\nNow I am going to attempt to append to the tape.\n");
    wrcmd(); 
    weofcmd();
 //   weofcmd();
    rewindcmd();
    scancmd();
-   Dmsg0(0, "The above scan should have four files of:\n\
+   Pmsg0(0, "The above scan should have four files of:\n\
 One record, two records, three records, and one record respectively.\n\n");
 
 
-   Dmsg0(0, "Append block test.\n\n\
+   Pmsg0(0, "Append block test.\n\n\
 I'm going to write a block, an EOF, rewind, go to EOM,\n\
 then backspace over the EOF and attempt to append a\
 second block in the first file.\n\n");
@@ -690,17 +690,17 @@ second block in the first file.\n\n");
 //   weofcmd();
    rewindcmd();
    eodcmd();
-   Dmsg2(0, "We should be at file 1. I am at EOM File=%d. This is %s\n",
+   Pmsg2(0, "We should be at file 1. I am at EOM File=%d. This is %s\n",
       dev->file, dev->file == 1 ? "correct!" : "NOT correct!!!!");
-   Dmsg0(0, "Doing backspace file.\n");
+   Pmsg0(0, "Doing backspace file.\n");
    bsfcmd();
-   Dmsg0(0, "Write second block, hoping to append to first file.\n");
+   Pmsg0(0, "Write second block, hoping to append to first file.\n");
    wrcmd();
    weofcmd();
    rewindcmd();
-   Dmsg0(0, "Done writing, scanning results\n");
+   Pmsg0(0, "Done writing, scanning results\n");
    scancmd();
-   Dmsg0(0, "The above should have one file of two blocks.\n");
+   Pmsg0(0, "The above should have one file of two blocks.\n");
 }
 
 
@@ -708,28 +708,28 @@ static void fsfcmd()
 {
    int stat;
    if (!dev) {
-      Dmsg0(0, "No device: Use device command.\n");
+      Pmsg0(0, "No device: Use device command.\n");
       return;
    }
    if ((stat=fsf_dev(dev, 1)) < 0) {
-      Dmsg2(0, "Bad status from fsf %d. ERR=%s\n", stat, strerror_dev(dev));
+      Pmsg2(0, "Bad status from fsf %d. ERR=%s\n", stat, strerror_dev(dev));
       return;
    }
-   Dmsg0(0, "Forward spaced one file.\n");
+   Pmsg0(0, "Forward spaced one file.\n");
 }
 
 static void fsrcmd()
 {
    int stat;
    if (!dev) {
-      Dmsg0(0, "No device: Use device command.\n");
+      Pmsg0(0, "No device: Use device command.\n");
       return;
    }
    if ((stat=fsr_dev(dev, 1)) < 0) {
-      Dmsg2(0, "Bad status from fsr %d. ERR=%s\n", stat, strerror_dev(dev));
+      Pmsg2(0, "Bad status from fsr %d. ERR=%s\n", stat, strerror_dev(dev));
       return;
    }
-   Dmsg0(0, "Forward spaced one record.\n");
+   Pmsg0(0, "Forward spaced one record.\n");
 }
 
 static void rdcmd()
@@ -738,14 +738,14 @@ static void rdcmd()
    int stat;
 
    if (!dev) {
-      Dmsg0(0, "No device: Use device command.\n");
+      Pmsg0(0, "No device: Use device command.\n");
       return;
    }
    if (!read_dev(dev, buf, 512*126)) {
-      Dmsg1(0, "Bad status from read. ERR=%s\n", strerror_dev(dev));
+      Pmsg1(0, "Bad status from read. ERR=%s\n", strerror_dev(dev));
       return;
    }
-   Dmsg1(10, "Read %d bytes\n", stat);
+   Pmsg1(10, "Read %d bytes\n", stat);
 #else
    printf("Rdcmd no longer implemented.\n");
 #endif
@@ -759,7 +759,7 @@ static void wrcmd()
    int i;
 
    if (!dev) {
-      Dmsg0(0, "No device: Use device command.\n");
+      Pmsg0(0, "No device: Use device command.\n");
       return;
    }
    sm_check(__FILE__, __LINE__, False);
@@ -772,14 +772,14 @@ static void wrcmd()
    rec->data_len = i;
    sm_check(__FILE__, __LINE__, False);
    if (!write_record_to_block(block, rec)) {
-      Dmsg0(0, "Error writing record to block.\n"); 
+      Pmsg0(0, "Error writing record to block.\n"); 
       return;
    }
    if (!write_block_to_dev(dev, block)) {
-      Dmsg0(0, "Error writing block to device.\n"); 
+      Pmsg0(0, "Error writing block to device.\n"); 
       return;
    } else {
-      Dmsg1(0, "Wrote one record of %d bytes.\n",
+      Pmsg1(0, "Wrote one record of %d bytes.\n",
         ((i+TAPE_BSIZE-1)/TAPE_BSIZE) * TAPE_BSIZE);
    }
 
@@ -787,7 +787,7 @@ static void wrcmd()
    free_record(rec);
    free_block(block);
    sm_check(__FILE__, __LINE__, False);
-   Dmsg0(0, "Wrote block to device.\n");
+   Pmsg0(0, "Wrote block to device.\n");
 }
 
 
@@ -803,13 +803,13 @@ static void scancmd()
    uint64_t bytes;
 
    if (!dev) {
-      Dmsg0(0, "No device: Use device command.\n");
+      Pmsg0(0, "No device: Use device command.\n");
       return;
    }
    blocks = block_size = tot_blocks = 0;
    bytes = 0;
    if (dev->state & ST_EOT) {
-      Dmsg0(0, "End of tape\n");
+      Pmsg0(0, "End of tape\n");
       return; 
    }
    update_pos_dev(dev);
@@ -819,7 +819,7 @@ static void scancmd()
         clrerror_dev(dev, -1);
          Mmsg2(&dev->errmsg, "read error on %s. ERR=%s.\n",
            dev->dev_name, strerror(dev->dev_errno));
-         Dmsg2(0, "Bad status from read %d. ERR=%s\n", stat, strerror_dev(dev));
+         Pmsg2(0, "Bad status from read %d. ERR=%s\n", stat, strerror_dev(dev));
         if (blocks > 0)
             printf("%d block%s of %d bytes in file %d\n",        
                     blocks, blocks>1?"s":"", block_size, dev->file);
@@ -869,13 +869,13 @@ static void statcmd()
    uint32_t status;
 
    if (!dev) {
-      Dmsg0(0, "No device: Use device command.\n");
+      Pmsg0(0, "No device: Use device command.\n");
       return;
    }
    debug = debug_level;
    debug_level = 30;
    if (!status_dev(dev, &status)) {
-      Dmsg2(0, "Bad status from status %d. ERR=%s\n", stat, strerror_dev(dev));
+      Pmsg2(0, "Bad status from status %d. ERR=%s\n", stat, strerror_dev(dev));
    }
 #ifdef xxxx
    dump_volume_label(dev);
@@ -897,68 +897,68 @@ static void appendcmd()
    DEV_BLOCK *block;
 
    if (!dev) {
-      Dmsg0(0, "No device: Use device command.\n");
+      Pmsg0(0, "No device: Use device command.\n");
       return;
    }
 
    block = new_block(dev);
 
    if (!ready_device_for_append(jcr, dev, block, VolName)) {
-      Dmsg0(0, "Cannot append, not a Bacula tape.\n");
+      Pmsg0(0, "Cannot append, not a Bacula tape.\n");
       return;
    }
 
    file = dev_file(dev);
-   Dmsg1(0, "Begin write test data in file %d\n", file);
+   Pmsg1(0, "Begin write test data in file %d\n", file);
 
    /* Write our test data */
    for (i=0; i<100; i++) {
       j = 10000 + i;
       memset(buf, i, j);
       if (!write_dev(dev, buf, j)) {
-         Dmsg1(0, "Bad status from write. ERR=%s\n", strerror_dev(dev));
+         Pmsg1(0, "Bad status from write. ERR=%s\n", strerror_dev(dev));
         return;
       }
-     Dmsg2(10, "Wrote %d bytes of %d\n", j, i);
+     Pmsg2(10, "Wrote %d bytes of %d\n", j, i);
    }
 
    if (flush_dev(dev) != 0) {                 /* ensure written to tape */
-      Dmsg1(0, "Flush error: %s\n", strerror(errno));
+      Pmsg1(0, "Flush error: %s\n", strerror(errno));
    }
    if (weof_dev(dev, 1) != 0) { 
-      Dmsg1(0, "EOF error: %s\n", strerror(errno));
+      Pmsg1(0, "EOF error: %s\n", strerror(errno));
    }
 
-   Dmsg0(0, "Rewind and reread label\n");
+   Pmsg0(0, "Rewind and reread label\n");
    if (read_dev_volume_label(dev, VolName) != VOL_OK) {
       return;
    }
 
    if (file != 0) { 
-      Dmsg1(0, "FSF %d files\n", file);
+      Pmsg1(0, "FSF %d files\n", file);
       fsf_dev(dev, file);
    }
       
    file = dev_file(dev);
-   Dmsg1(0, "Begin read/test from file %d\n", file);
+   Pmsg1(0, "Begin read/test from file %d\n", file);
    /* Now read our test data and make sure it is what we wrote */
    for (i=0; i<100; i++) {
       j = 10000 + i;
       if (!read_dev(dev, buf, j)) {
-         Dmsg1(0, "Bad status from read. ERR=%s\n", strerror_dev(dev));
+         Pmsg1(0, "Bad status from read. ERR=%s\n", strerror_dev(dev));
         return;
       }
       for (k=0; k<j; k++) {
         if (buf[k] != i) {
-            Dmsg5(0, "Data read expected %d got %d at byte %d, block %d size %d\n", 
+            Pmsg5(0, "Data read expected %d got %d at byte %d, block %d size %d\n", 
             i, buf[k], k, i, j);
            return;
         }
       }     
-      Dmsg3(10, "Successful read block %d of %d bytes of %d\n", i, j, i);
+      Pmsg3(10, "Successful read block %d of %d bytes of %d\n", i, j, i);
    }
 
-   Dmsg0(0, "Reread test data successfully.\n");
+   Pmsg0(0, "Reread test data successfully.\n");
 #else 
    printf("append command no longer implemented.\n");
 #endif
@@ -1011,7 +1011,7 @@ do_tape_cmds()
            break;
         }
       if (!found)
-         Dmsg1(0, "%s is an illegal command\n", cmd);
+         Pmsg1(0, "%s is an illegal command\n", cmd);
       if (quit)
         break;
    }
index 3afca1a2705337dd4512d94412521c86e07c9e7f..6dafcc897337925b9addb4ce6b5b69d9e312ec94 100644 (file)
@@ -22,7 +22,7 @@
  *
  *     Unfortunately, I have had to add more and more complication
  *     to this code. This was not foreseen as noted above, and as
- *     a consequence has lead to something more contored than is
+ *     a consequence has lead to something more contorted than is
  *     really necessary -- KES.  Note, this contortion has been
  *     corrected to a large extent by a rewrite (Apr MMI).
  *
@@ -49,7 +49,7 @@
  */
 
 /*
- * Handling I/O errors and end of tape conditions is a bit tricky.
+ * Handling I/O errors and end of tape conditions are a bit tricky.
  * This is how it is currently done when writting.
  * On either an I/O error or end of tape,
  * we will stop writing on the physical device (no I/O recovery is
@@ -176,7 +176,7 @@ init_dev(DEVICE *dev, char *dev_name)
 int
 open_dev(DEVICE *dev, char *VolName, int mode)
 {
-   char *archive_name;
+   POOLMEM *archive_name;
 
    if (dev->state & ST_OPENED) {
       /*
@@ -221,7 +221,7 @@ open_dev(DEVICE *dev, char *VolName, int mode)
       }
       Dmsg1(29, "open_dev: tape %d opened\n", dev->fd);
    } else {
-      archive_name = (char *) get_pool_memory(PM_FNAME);
+      archive_name = get_pool_memory(PM_FNAME);
       strcpy(archive_name, dev->dev_name);
       if (archive_name[strlen(archive_name)] != '/') {
          strcat(archive_name, "/");
@@ -264,7 +264,7 @@ int rewind_dev(DEVICE *dev)
       dev->dev_errno = EBADF;
       Mmsg1(&dev->errmsg, _("Bad call to rewind_dev. Device %s not open\n"),
            dev->dev_name);
-      Emsg0(M_ABORT, 0, dev->errmsg);
+      Emsg0(M_FATAL, 0, dev->errmsg);
       return 0;
    }
    dev->state &= ~(ST_APPEND|ST_READ|ST_EOT | ST_EOF | ST_WEOT);  /* remove EOF/EOT flags */
@@ -969,6 +969,9 @@ close_dev(DEVICE *dev)
    dev->use_count--;
 }
 
+/*
+ * Used when unmounting the device
+ */
 void force_close_dev(DEVICE *dev)
 {
    if (!dev) {
index f01b928f52fcedd341655e5a7b874df1505fab54..53aa0f736b06db80a8505a1b53c2e671a7a66927 100644 (file)
 
 
 /* Bits for device capabilities */
-#define CAP_EOF        0x001          /* has MTWEOF */
-#define CAP_BSR        0x002          /* has MTBSR */
-#define CAP_BSF        0x004          /* has MTBSF */
-#define CAP_FSR        0x008          /* has MTFSR */
-#define CAP_FSF        0x010          /* has MTFSF */
-#define CAP_EOM        0x020          /* has MTEOM */
-#define CAP_REM        0x040          /* is removable media */
-#define CAP_RACCESS    0x080          /* is random access device */
-#define CAP_AUTOMOUNT  0x100          /* Read device at start to see what is there */
-#define CAP_LABEL      0x200          /* Label blank tapes */
-#define CAP_ANONVOLS   0x400          /* Mount without knowing volume name */
-#define CAP_ALWAYSOPEN 0x800          /* always keep device open */
+#define CAP_EOF          0x0001       /* has MTWEOF */
+#define CAP_BSR          0x0002       /* has MTBSR */
+#define CAP_BSF          0x0004       /* has MTBSF */
+#define CAP_FSR          0x0008       /* has MTFSR */
+#define CAP_FSF          0x0010       /* has MTFSF */
+#define CAP_EOM          0x0020       /* has MTEOM */
+#define CAP_REM          0x0040       /* is removable media */
+#define CAP_RACCESS      0x0080       /* is random access device */
+#define CAP_AUTOMOUNT    0x0100       /* Read device at start to see what is there */
+#define CAP_LABEL        0x0200       /* Label blank tapes */
+#define CAP_ANONVOLS     0x0400       /* Mount without knowing volume name */
+#define CAP_ALWAYSOPEN   0x0800       /* always keep device open */
+#define CAP_AUTOCHANGER  0x1000       /* AutoChanger */
+#define CAP_OFFLINEUNMOUNT 0x2000     /* Offline before unmount */
 
 
 /* Tape state bits */
@@ -94,6 +96,7 @@ typedef struct s_volume_catalog_info {
    uint32_t VolCatWrites;             /* Number of writes this volume */
    uint32_t VolCatReads;              /* Number of reads this volume */
    uint32_t VolCatRecycles;           /* Number of recycles this volume */
+   int32_t  Slot;                     /* Slot in changer */
    uint64_t VolCatMaxBytes;           /* max bytes to write */
    uint64_t VolCatCapacityBytes;      /* capacity estimate */
    char VolCatStatus[20];             /* Volume status */
index 26038854efd6b4412b4af4783eba864a094f40e8..80e55fb1b4994f6dcd33dd6d9912e2f0784f4748 100644 (file)
@@ -307,7 +307,7 @@ static int ready_dev_for_append(JCR *jcr, DEVICE *dev, DEV_BLOCK *block)
        */
       if (!dir_find_next_appendable_volume(jcr)) {
         if (!dir_ask_sysop_to_mount_next_volume(jcr, dev)) {
-            Jmsg1(jcr, M_ERROR, 0, _("Unable to mount desired Volume for device %s.\n"),
+            Jmsg1(jcr, M_FATAL, 0, _("Unable to mount desired Volume for device %s.\n"),
               dev_name(dev));
            return 0;              /* error return */
         }
@@ -369,7 +369,7 @@ mount_next_vol:
             Jmsg(jcr, M_WARNING, 0, "%s", jcr->errmsg);                         
            rewind_dev(dev);
            if (!dir_ask_sysop_to_mount_next_volume(jcr, dev)) {
-               Jmsg1(jcr, M_ERROR, 0, _("Unable to mount desired Volume for device %s.\n"),
+               Jmsg1(jcr, M_FATAL, 0, _("Unable to mount desired Volume for device %s.\n"),
                  dev_name(dev));
               return 0;              /* error return */
            }
index 1d9a9627720ba181cfc05e35b4043c188cf6e0db..a7511945cc8f9caa82f1c30433fe88ae19196f5b 100644 (file)
@@ -543,6 +543,9 @@ static int unmount_cmd(JCR *jcr)
         } else if (dev->dev_blocked == BST_WAITING_FOR_SYSOP) {
             Dmsg2(90, "%d waiter dev_block=%d. doing unmount\n", dev->num_waiting,
               dev->dev_blocked);
+           if (dev->capabilities & CAP_OFFLINEUNMOUNT) {
+              offline_dev(dev);
+           }
            force_close_dev(dev);
            dev->dev_blocked = BST_UNMOUNTED_WAITING_FOR_SYSOP;
             bnet_fsend(dir, _("3001 Device %s unmounted.\n"), dev_name(dev));
@@ -569,6 +572,9 @@ static int unmount_cmd(JCR *jcr)
         } else {                     /* device not being used */
             Dmsg0(90, "Device not in use, unmounting\n");
            block_device(dev, BST_UNMOUNTED);
+           if (dev->capabilities & CAP_OFFLINEUNMOUNT) {
+              offline_dev(dev);
+           }
            force_close_dev(dev);
             bnet_fsend(dir, _("3002 Device %s unmounted.\n"), dev_name(dev));
         }
index c462f583485096f49a636b26b119b4f4ad326bb0..cd6e49693c4d5f337a5a1bf6440a674712ee73d5 100644 (file)
@@ -174,13 +174,13 @@ void connection_from_filed(void *arg)
 
    Dmsg0(200, "enter connection_from_filed\n");
    if (bnet_recv(fd) <= 0) {
-      Emsg0(M_ERROR, 0, "Unable to authenticate Client.\n");
+      Emsg0(M_FATAL, 0, _("Unable to authenticate Client.\n"));
       return;
    }
    Dmsg1(100, "got: %s\n", fd->msg);
 
    if (sscanf(fd->msg, "Hello Start Job %127s\n", job_name) != 1) {
-      Emsg1(M_ERROR, 0, _("Authentication failure: %s"), fd->msg);
+      Emsg1(M_FATAL, 0, _("Authentication failure: %s\n"), fd->msg);
       return;
    }
    handle_filed_connection(fd, job_name);
@@ -192,7 +192,7 @@ void handle_filed_connection(BSOCK *fd, char *job_name)
    JCR *jcr;
 
    if (!(jcr=get_jcr_by_full_name(job_name))) {
-      Emsg1(M_ERROR, 0, "Job name not found: %s", job_name);
+      Emsg1(M_FATAL, 0, _("Job name not found: %s\n"), job_name);
       return;
    }
 
@@ -201,7 +201,7 @@ void handle_filed_connection(BSOCK *fd, char *job_name)
    Dmsg1(100, "Found Job %s\n", job_name);
 
    if (jcr->authenticated) {
-      Dmsg2(000, "Hey!!!! JobId %d Job %s already authenticated.\n", 
+      Pmsg2(000, "Hey!!!! JobId %d Job %s already authenticated.\n", 
         jcr->JobId, jcr->Job);
    }
   
@@ -285,7 +285,7 @@ static int use_device_cmd(JCR *jcr)
           dev_name);
       bnet_fsend(dir, NO_device, dev_name);
    } else {
-      Emsg1(M_FATAL, 0, _("store<dir: Bad Use Device command: %s\n"), dir->msg);
+      Jmsg(jcr, M_FATAL, 0, _("store<dir: Bad Use Device command: %s\n"), dir->msg);
       bnet_fsend(dir, BAD_use, dir->msg);
    }
 
index ff9f5b05d2ade3847caac5d3afe2eee895189a70..d4d4a2ea3968b7f106f404e63b88f0f37a8d5a1f 100644 (file)
@@ -235,7 +235,7 @@ int write_volume_label_to_block(JCR *jcr, DEVICE *dev, DEV_BLOCK *block)
    empty_block(block);               /* Volume label always at beginning */
    if (!write_record_to_block(block, &rec)) {
       free_pool_memory(rec.data);
-      Emsg1(M_ERROR, 0, _("Cannot write Volume label to block for device %s\n"),
+      Jmsg1(jcr, M_FATAL, 0, _("Cannot write Volume label to block for device %s\n"),
         dev_name(dev));
       return 0;
    } else {
@@ -475,7 +475,7 @@ int write_session_label(JCR *jcr, DEV_BLOCK *block, int label)
         jcr->end_file = dev->file;
         break;
       default:
-         Emsg1(M_ABORT, 0, _("Bad session label = %d\n"), label);
+         Jmsg1(jcr, M_ABORT, 0, _("Bad session label = %d\n"), label);
         break;
    }
    create_session_label(jcr, rec, label);
@@ -535,7 +535,7 @@ void dump_volume_label(DEVICE *dev)
    
    dbl = debug_level;
    debug_level = 1;
-   Dmsg11(-1, "\nVolume Label:\n\
+   Pmsg11(-1, "\nVolume Label:\n\
 Id                : %s\
 VerNo             : %d\n\
 VolName           : %s\n\
@@ -557,7 +557,7 @@ HostName          : %s\n\
    dt.julian_day_number   = dev->VolHdr.label_date;
    dt.julian_day_fraction = dev->VolHdr.label_time;
    tm_decode(&dt, &tm);
-   Dmsg5(-1, "\
+   Pmsg5(-1, "\
 Date label written: %04d-%02d-%02d at %02d:%02d\n", 
       tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday, tm.tm_hour, tm.tm_min);
    debug_level = dbl;
@@ -608,7 +608,7 @@ static void dump_session_label(DEV_RECORD *rec, char *type)
    unser_session_label(&label, rec);
    dbl = debug_level;
    debug_level = 1;
-   Dmsg6(-1, "\n%s Record:\n\
+   Pmsg6(-1, "\n%s Record:\n\
 JobId             : %d\n\
 PoolName          : %s\n\
 PoolType          : %s\n\
@@ -619,7 +619,7 @@ ClientName        : %s\n\
       label.JobName, label.ClientName);
 
    if (label.VerNum >= 10) {
-      Dmsg4(-1, "\
+      Pmsg4(-1, "\
 Job (unique name) : %s\n\
 FileSet           : %s\n\
 JobType           : %c\n\
@@ -628,7 +628,7 @@ JobLevel          : %c\n\
    }
 
    if (rec->FileIndex == EOS_LABEL) {
-      Dmsg7(-1, "\
+      Pmsg7(-1, "\
 JobFiles          : %s\n\
 JobBytes          : %s\n\
 StartBlock        : %s\n\
@@ -648,7 +648,7 @@ JobErrors         : %s\n\
    dt.julian_day_number   = label.write_date;
    dt.julian_day_fraction = label.write_time;
    tm_decode(&dt, &tm);
-   Dmsg5(-1, "\
+   Pmsg5(-1, "\
 Date written      : %04d-%02d-%02d at %02d:%02d\n", 
       tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday, tm.tm_hour, tm.tm_min);
 
@@ -696,16 +696,16 @@ void dump_label_record(DEVICE *dev, DEV_RECORD *rec, int verbose)
            dump_session_label(rec, type);
            break;
         case EOM_LABEL:
-            Dmsg5(-1, "%s Record: VSessId=%d VSessTime=%d JobId=%d DataLen=%d\n",
+            Pmsg5(-1, "%s Record: VSessId=%d VSessTime=%d JobId=%d DataLen=%d\n",
               type, rec->VolSessionId, rec->VolSessionTime, rec->Stream, rec->data_len);
            break;
         default:
-            Dmsg5(-1, "%s Record: VSessId=%d VSessTime=%d JobId=%d DataLen=%d\n",
+            Pmsg5(-1, "%s Record: VSessId=%d VSessTime=%d JobId=%d DataLen=%d\n",
               type, rec->VolSessionId, rec->VolSessionTime, rec->Stream, rec->data_len);
            break;
       }
    } else {
-      Dmsg5(-1, "%s Record: VSessId=%d VSessTime=%d JobId=%d DataLen=%d\n",
+      Pmsg5(-1, "%s Record: VSessId=%d VSessTime=%d JobId=%d DataLen=%d\n",
         type, rec->VolSessionId, rec->VolSessionTime, rec->Stream, rec->data_len);
    }
    debug_level = dbl;
index 21d5a19420415b4ec4f6f1041a893b728c0626df..ad869bdffe1edb27f49e9aa9da9efcc1b2b18783 100755 (executable)
@@ -41,6 +41,7 @@ static int match_job_level(BSR_JOBLEVEL *job_level, SESSION_LABEL *sessrec);
 static int match_jobid(BSR_JOBID *jobid, SESSION_LABEL *sessrec);
 static int match_findex(BSR_FINDEX *findex, DEV_RECORD *rec);
 static int match_volfile(BSR_VOLFILE *volfile, DEV_RECORD *rec);
+static int match_stream(BSR_STREAM *stream, DEV_RECORD *rec);
 static int match_one_bsr(BSR *bsr, DEV_RECORD *rec, VOLUME_LABEL *volrec, SESSION_LABEL *sessrec);
 
 /*********************************************************************
@@ -91,6 +92,9 @@ static int match_one_bsr(BSR *bsr, DEV_RECORD *rec, VOLUME_LABEL *volrec, SESSIO
    if (!match_job_level(bsr->JobLevel, sessrec)) {
       return 0;
    }
+   if (!match_stream(bsr->stream, rec)) {
+      return 0;
+   }
    return 1;
 }
 
@@ -183,6 +187,19 @@ static int match_volfile(BSR_VOLFILE *volfile, DEV_RECORD *rec)
    return 0;
 }
 
+static int match_stream(BSR_STREAM *stream, DEV_RECORD *rec)
+{
+   if (!stream) {
+      return 1;                      /* no specification matches all */
+   }
+   if (stream->stream == rec->Stream) {
+      return 1;
+   }
+   if (stream->next) {
+      return match_stream(stream->next, rec);
+   }
+   return 0;
+}
 
 static int match_findex(BSR_FINDEX *findex, DEV_RECORD *rec)
 {
index 522b19b05a0907a3479dc1d3a2e724b07dd02594..1d5ba45a252cb90fbce5b179d904d232b46625ea 100755 (executable)
@@ -43,6 +43,8 @@ static BSR *store_volfile(LEX *lc, BSR *bsr);
 static BSR *store_sesstime(LEX *lc, BSR *bsr);
 static BSR *store_include(LEX *lc, BSR *bsr);
 static BSR *store_exclude(LEX *lc, BSR *bsr);
+static BSR *store_stream(LEX *lc, BSR *bsr);
+static BSR *store_slot(LEX *lc, BSR *bsr);
 
 struct kw_items {
    char *name;
@@ -62,6 +64,8 @@ struct kw_items items[] = {
    {"include", store_include},
    {"exclude", store_exclude},
    {"volfile", store_volfile},
+   {"stream",  store_stream},
+   {"slot",    store_slot},
    {NULL, NULL}
 
 };
@@ -405,6 +409,51 @@ static BSR *store_sesstime(LEX *lc, BSR *bsr)
    return bsr;
 }
 
+
+static BSR *store_stream(LEX *lc, BSR *bsr)
+{
+   int token;
+   BSR_STREAM *stream;
+
+   for (;;) {
+      token = lex_get_token(lc, T_INT32);
+      if (token == T_ERROR) {
+        return NULL;
+      }
+      stream = (BSR_STREAM *)malloc(sizeof(BSR_STREAM));
+      memset(stream, 0, sizeof(BSR_STREAM));
+      stream->stream = lc->int32_val;
+      /* Add it to the end of the chain */
+      if (!bsr->stream) {
+        bsr->stream = stream;
+      } else {
+        /* Add to end of chain */
+        BSR_STREAM *bs = bsr->stream;
+        for ( ;bs->next; bs=bs->next)
+           { }
+        bs->next = stream;
+      }
+      token = lex_get_token(lc, T_ALL);
+      if (token != T_COMMA) {
+        break;
+      }
+   }
+   return bsr;
+}
+
+static BSR *store_slot(LEX *lc, BSR *bsr)
+{
+   int token;
+
+   token = lex_get_token(lc, T_PINT32);
+   if (token == T_ERROR) {
+      return NULL;
+   }
+   bsr->Slot = lc->pint32_val;
+   scan_to_eol(lc);
+   return bsr;
+}
+
 static BSR *store_include(LEX *lc, BSR *bsr)
 {
    scan_to_eol(lc);
index baf57f549d1cc124c09ac5e27cabc53f46bc0c1c..f298a533221fd199e4e8b9bbfe7c87d80dc2a774 100644 (file)
@@ -131,7 +131,7 @@ int do_read_data(JCR *jcr)
                Dmsg1(000, "There is another volume %s.\n", jcr->VolumeName);
               dev->state &= ~ST_READ; 
               if (!acquire_device_for_read(jcr, dev, block)) {
-                  Emsg2(M_ERROR, 0, "Cannot open Dev=%s, Vol=%s\n", dev_name(dev), jcr->VolumeName);
+                  Jmsg(jcr, M_FATAL, 0, _("Cannot open Dev=%s, Vol=%s\n"), dev_name(dev), jcr->VolumeName);
                  ok = FALSE;
                  break;
               }
@@ -150,7 +150,7 @@ int do_read_data(JCR *jcr)
            continue;                 /* End of File */
         }
 
-         Jmsg2(jcr, M_FATAL, 0, "Read error on Record Header %s ERR=%s\n", dev_name(dev), strerror(errno));
+         Jmsg2(jcr, M_FATAL, 0, _("Read error on Record Header %s ERR=%s\n"), dev_name(dev), strerror(errno));
         ok = FALSE;
         break;
       }
index 568ad16e73ffd83a9be41d0b5cac8c2cd6c131aa..4259baa282076f62a265c822259ecafa53b95c3c 100644 (file)
@@ -249,6 +249,9 @@ int main (int argc, char *argv[])
    UnlockRes();
    device = NULL;
 
+   set_thread_concurrency(me->max_concurrent_jobs * 2 +
+      4 /* watch dog + servers + misc */);
+
    start_watchdog();                 /* start watchdog thread */
 
    /*
@@ -256,10 +259,10 @@ int main (int argc, char *argv[])
     */
    if (me->SDDport == 0 || me->SDDport == me->SDport) {
       /* Single server used for Director and File daemon */
-      bnet_thread_server(me->SDport, 20, &dird_workq, connection_request);
+      bnet_thread_server(me->SDport, me->max_concurrent_jobs * 2,
+        &dird_workq, connection_request);
    } else {
       /* Start the Director server */
-      set_thread_concurrency(10);
       if ((status=pthread_create(&dirid, NULL, director_thread,        
           (void *)me->SDport)) != 0) {
          Emsg1(M_ABORT, 0, _("Cannot create Director thread: %s\n"), strerror(status));
index c034df374a2b9755a595d7f2841eb33d7eeb5cf9..3020ea4f76c1a0e6db1dc15b315478f6ea86c078 100644 (file)
@@ -93,6 +93,8 @@ static struct res_items dev_items[] = {
    {"labelmedia",            store_yesno,  ITEM(res_dev.cap_bits), CAP_LABEL,      ITEM_DEFAULT, 0},
    {"mountanonymousvolumes", store_yesno,  ITEM(res_dev.cap_bits), CAP_ANONVOLS,   ITEM_DEFAULT, 0},
    {"alwaysopen",            store_yesno,  ITEM(res_dev.cap_bits), CAP_ALWAYSOPEN, ITEM_DEFAULT, 1},
+   {"autochanger",           store_yesno,  ITEM(res_dev.cap_bits), CAP_AUTOCHANGER, ITEM_DEFAULT, 0},
+   {"offlineonunmount",      store_yesno,  ITEM(res_dev.cap_bits), CAP_OFFLINEUNMOUNT, ITEM_DEFAULT, 1},
    {"maximumrewindwait",     store_pint,   ITEM(res_dev.max_rewind_wait), 0, ITEM_DEFAULT, 5 * 60},
    {"minimumblocksize",      store_pint,   ITEM(res_dev.min_block_size), 0, 0, 0},
    {"maximumblocksize",      store_pint,   ITEM(res_dev.max_block_size), 0, 0, 0},
@@ -114,7 +116,7 @@ struct s_res resources[] = {
    {"storage",       store_items, R_STORAGE,   NULL},
    {"device",        dev_items,   R_DEVICE,    NULL},
    {"messages",      msgs_items,  R_MSGS,      NULL},
-   {NULL,           NULL,        0,           NULL}
+   {NULL,            NULL,        0,           NULL}
 };
 
 
@@ -130,81 +132,81 @@ void dump_resource(int type, RES *reshdr, void sendit(void *sock, char *fmt, ...
       return;
    }
    sendit(sock, "dump_resource type=%d\n", type);
-   if (type < 0) {                   /* no recursion */
+   if (type < 0) {                    /* no recursion */
       type = - type;
       recurse = 0;
    }
    switch (type) {
       case R_DIRECTOR:
          sendit(sock, "Director: name=%s\n", res->res_dir.hdr.name);
-        break;
+         break;
       case R_STORAGE:
          sendit(sock, "Storage: name=%s address=%s SDport=%d SDDport=%d\n",
-           res->res_store.hdr.name, res->res_store.address, 
-           res->res_store.SDport, res->res_store.SDDport);
-        break;
+            res->res_store.hdr.name, res->res_store.address, 
+            res->res_store.SDport, res->res_store.SDDport);
+         break;
       case R_DEVICE:
          sendit(sock, "Device: name=%s MediaType=%s Device=%s\n",
-           res->res_dev.hdr.name,
-           res->res_dev.media_type, res->res_dev.device_name);
+            res->res_dev.hdr.name,
+            res->res_dev.media_type, res->res_dev.device_name);
          sendit(sock, "        rew_wait=%d min_bs=%d max_bs=%d\n",
-           res->res_dev.max_rewind_wait, res->res_dev.min_block_size, 
-           res->res_dev.max_block_size);
+            res->res_dev.max_rewind_wait, res->res_dev.min_block_size, 
+            res->res_dev.max_block_size);
          sendit(sock, "        max_jobs=%d max_files=%" lld " max_size=%" lld "\n",
-           res->res_dev.max_volume_jobs, res->res_dev.max_volume_files,
-           res->res_dev.max_volume_size);
+            res->res_dev.max_volume_jobs, res->res_dev.max_volume_files,
+            res->res_dev.max_volume_size);
          sendit(sock, "        max_file_size=%" lld " capacity=%" lld "\n",
-           res->res_dev.max_file_size, res->res_dev.volume_capacity);
+            res->res_dev.max_file_size, res->res_dev.volume_capacity);
          strcpy(buf, "        ");
-        if (res->res_dev.cap_bits & CAP_EOF) {
+         if (res->res_dev.cap_bits & CAP_EOF) {
             strcat(buf, "CAP_EOF ");
-        }
-        if (res->res_dev.cap_bits & CAP_BSR) {
+         }
+         if (res->res_dev.cap_bits & CAP_BSR) {
             strcat(buf, "CAP_BSR ");
-        }
-        if (res->res_dev.cap_bits & CAP_BSF) {
+         }
+         if (res->res_dev.cap_bits & CAP_BSF) {
             strcat(buf, "CAP_BSF ");
-        }
-        if (res->res_dev.cap_bits & CAP_FSR) {
+         }
+         if (res->res_dev.cap_bits & CAP_FSR) {
             strcat(buf, "CAP_FSR ");
-        }
-        if (res->res_dev.cap_bits & CAP_FSF) {
+         }
+         if (res->res_dev.cap_bits & CAP_FSF) {
             strcat(buf, "CAP_FSF ");
-        }
-        if (res->res_dev.cap_bits & CAP_EOM) {
+         }
+         if (res->res_dev.cap_bits & CAP_EOM) {
             strcat(buf, "CAP_EOM ");
-        }
-        if (res->res_dev.cap_bits & CAP_REM) {
+         }
+         if (res->res_dev.cap_bits & CAP_REM) {
             strcat(buf, "CAP_REM ");
-        }
-        if (res->res_dev.cap_bits & CAP_RACCESS) {
+         }
+         if (res->res_dev.cap_bits & CAP_RACCESS) {
             strcat(buf, "CAP_RACCESS ");
-        }
-        if (res->res_dev.cap_bits & CAP_AUTOMOUNT) {
+         }
+         if (res->res_dev.cap_bits & CAP_AUTOMOUNT) {
             strcat(buf, "CAP_AUTOMOUNT ");
-        }
-        if (res->res_dev.cap_bits & CAP_LABEL) {
+         }
+         if (res->res_dev.cap_bits & CAP_LABEL) {
             strcat(buf, "CAP_LABEL ");
-        }
-        if (res->res_dev.cap_bits & CAP_ANONVOLS) {
+         }
+         if (res->res_dev.cap_bits & CAP_ANONVOLS) {
             strcat(buf, "CAP_ANONVOLS ");
-        }
-        if (res->res_dev.cap_bits & CAP_ALWAYSOPEN) {
+         }
+         if (res->res_dev.cap_bits & CAP_ALWAYSOPEN) {
             strcat(buf, "CAP_ALWAYSOPEN ");
-        }
+         }
          strcat(buf, "\n");
-        sendit(sock, buf);
-        break;
+         sendit(sock, buf);
+         break;
       case R_MSGS:
          sendit(sock, "Messages: name=%s\n", res->res_msgs.hdr.name);
-        if (res->res_msgs.mail_cmd) 
+         if (res->res_msgs.mail_cmd) 
             sendit(sock, "      mailcmd=%s\n", res->res_msgs.mail_cmd);
-        if (res->res_msgs.operator_cmd) 
+         if (res->res_msgs.operator_cmd) 
             sendit(sock, "      opcmd=%s\n", res->res_msgs.operator_cmd);
-        break;
+         break;
       default:
          sendit(sock, _("Warning: unknown resource type %d\n"), type);
-        break;
+         break;
    }
    if (recurse && res->res_dir.hdr.next)
       dump_resource(type, (RES *)res->res_dir.hdr.next, sendit, sock);
@@ -234,38 +236,38 @@ void free_resource(int type)
 
    switch (type) {
       case R_DIRECTOR:
-        if (res->res_dir.password)
-           free(res->res_dir.password);
-        if (res->res_dir.address)
-           free(res->res_dir.address);
-        break;
+         if (res->res_dir.password)
+            free(res->res_dir.password);
+         if (res->res_dir.address)
+            free(res->res_dir.address);
+         break;
       case R_STORAGE:
-        if (res->res_store.address)
-           free(res->res_store.address);
-        if (res->res_store.working_directory)
-           free(res->res_store.working_directory);
-        if (res->res_store.pid_directory)
-           free(res->res_store.pid_directory);
-        if (res->res_store.subsys_directory)
-           free(res->res_store.subsys_directory);
-        break;
+         if (res->res_store.address)
+            free(res->res_store.address);
+         if (res->res_store.working_directory)
+            free(res->res_store.working_directory);
+         if (res->res_store.pid_directory)
+            free(res->res_store.pid_directory);
+         if (res->res_store.subsys_directory)
+            free(res->res_store.subsys_directory);
+         break;
       case R_DEVICE:
-        if (res->res_dev.media_type)
-           free(res->res_dev.media_type);
-        if (res->res_dev.device_name)
-           free(res->res_dev.device_name);
-        break;
+         if (res->res_dev.media_type)
+            free(res->res_dev.media_type);
+         if (res->res_dev.device_name)
+            free(res->res_dev.device_name);
+         break;
       case R_MSGS:
-        if (res->res_msgs.mail_cmd)
-           free(res->res_msgs.mail_cmd);
-        if (res->res_msgs.operator_cmd)
-           free(res->res_msgs.operator_cmd);
-        free_msgs_res((MSGS *)res);  /* free message resource */
-        res = NULL;
-        break;
+         if (res->res_msgs.mail_cmd)
+            free(res->res_msgs.mail_cmd);
+         if (res->res_msgs.operator_cmd)
+            free(res->res_msgs.operator_cmd);
+         free_msgs_res((MSGS *)res);  /* free message resource */
+         res = NULL;
+         break;
       default:
          Dmsg1(0, "Unknown resource type %d\n", type);
-        break;
+         break;
    }
    /* Common stuff again -- free the resource, recurse to next one */
    if (res) {
@@ -293,10 +295,10 @@ void save_resource(int type, struct res_items *items, int pass)
     */
    for (i=0; items[i].name; i++) {
       if (items[i].flags & ITEM_REQUIRED) {
-        if (!bit_is_set(i, res_all.res_dir.hdr.item_present)) {  
+         if (!bit_is_set(i, res_all.res_dir.hdr.item_present)) {  
             Emsg2(M_ABORT, 0, _("%s item is required in %s resource, but not found.\n"),
-             items[i].name, resources[rindex]);
-         }
+              items[i].name, resources[rindex]);
+          }
       }
       /* If this triggers, take a look at lib/parse_conf.h */
       if (i >= MAX_RES_ITEMS) {
@@ -311,33 +313,33 @@ void save_resource(int type, struct res_items *items, int pass)
     */
    if (pass == 2) {
       switch (type) {
-        /* Resources not containing a resource */
-        case R_DIRECTOR:
-        case R_DEVICE:
-        case R_MSGS:
-           break;
-
-        /* Resources containing a resource */
-        case R_STORAGE:
-           if ((res = (URES *)GetResWithName(R_STORAGE, res_all.res_dir.hdr.name)) == NULL) {
+         /* Resources not containing a resource */
+         case R_DIRECTOR:
+         case R_DEVICE:
+         case R_MSGS:
+            break;
+
+         /* Resources containing a resource */
+         case R_STORAGE:
+            if ((res = (URES *)GetResWithName(R_STORAGE, res_all.res_dir.hdr.name)) == NULL) {
                Emsg1(M_ABORT, 0, "Cannot find Storage resource %s\n", res_all.res_dir.hdr.name);
-           }
-           res->res_store.messages = res_all.res_store.messages;
-           break;
-        default:
+            }
+            res->res_store.messages = res_all.res_store.messages;
+            break;
+         default:
             printf("Unknown resource type %d\n", type);
-           error = 1;
-           break;
+            error = 1;
+            break;
       }
 
 
       if (res_all.res_dir.hdr.name) {
-        free(res_all.res_dir.hdr.name);
-        res_all.res_dir.hdr.name = NULL;
+         free(res_all.res_dir.hdr.name);
+         res_all.res_dir.hdr.name = NULL;
       }
       if (res_all.res_dir.hdr.desc) {
-        free(res_all.res_dir.hdr.desc);
-        res_all.res_dir.hdr.desc = NULL;
+         free(res_all.res_dir.hdr.desc);
+         res_all.res_dir.hdr.desc = NULL;
       }
       return;
    }
@@ -345,36 +347,36 @@ void save_resource(int type, struct res_items *items, int pass)
    /* The following code is only executed on pass 1 */
    switch (type) {
       case R_DIRECTOR:
-        size = sizeof(DIRRES);
-        break;
+         size = sizeof(DIRRES);
+         break;
       case R_STORAGE:
-        size = sizeof(STORES);
-        break;
+         size = sizeof(STORES);
+         break;
       case R_DEVICE:
-        size = sizeof(DEVRES);
-        break;
+         size = sizeof(DEVRES);
+         break;
       case R_MSGS:
-        size = sizeof(MSGS);   
-        break;
+         size = sizeof(MSGS);   
+         break;
       default:
          printf("Unknown resource type %d\n", type);
-        error = 1;
-        break;
+         error = 1;
+         break;
    }
    /* Common */
    if (!error) {
       res = (URES *)malloc(size);
       memcpy(res, &res_all, size);
       if (!resources[rindex].res_head) {
-        resources[rindex].res_head = (RES *)res; /* store first entry */
+         resources[rindex].res_head = (RES *)res; /* store first entry */
       } else {
-        RES *next;
-        /* Add new res to end of chain */
-        for (next=resources[rindex].res_head; next->next; next=next->next)
-           { }
-        next->next = (RES *)res;
+         RES *next;
+         /* Add new res to end of chain */
+         for (next=resources[rindex].res_head; next->next; next=next->next)
+            { }
+         next->next = (RES *)res;
          Dmsg2(90, "Inserting %s res: %s\n", res_to_str(type),
-              res->res_dir.hdr.name);
+               res->res_dir.hdr.name);
       }
    }
 }
index bbf8577b62f077c58354a4986e2c40c5310da4ef..fbb6563d8cc4c15250d9f093f89e0c5263dd06dc 100644 (file)
@@ -1,5 +1,5 @@
 /* */
-#define VERSION "1.22"
+#define VERSION "1.23"
 #define VSTRING "1"
 #define DATE    "7 July 2002"
 #define LSMDATE "07Jul02"