+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.
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}; \
AC_DEFUN(BA_CHECK_MYSQL_DB,
[
have_db=no
-db_name=none
AC_MSG_CHECKING(for MySQL support)
AC_ARG_WITH(mysql,
[
have_db=yes
support_mysql=yes
db_name=MySQL
+ DB_NAME=mysql
else
AC_MSG_RESULT(no)
AC_DEFUN(BA_CHECK_SQLITE_DB,
[
have_db=no
-db_name=none
AC_MSG_CHECKING(for SQLite support)
AC_ARG_WITH(sqlite,
[
have_db=yes
support_sqlite=yes
db_name=SQLite
+ DB_NAME=sqlite
else
AC_MSG_RESULT(no)
AC_DEFUN([GNOME_ORBIT_CHECK], [
GNOME_ORBIT_HOOK([],failure)
])
-
support_sqlite=no
support_smartalloc=yes
cats=
+db_name=Internal
+DB_NAME=bdb
dnl# --------------------------------------------------------------------------
dnl# CHECKING COMMAND LINE OPTIONS
-AC_SUBST(cats)
# ------------------------------------------------
# Bacula check for various SQL database engines
# ------------------------------------------------
BA_CHECK_SQLITE_DB
+AC_SUBST(cats)
+AC_SUBST(DB_NAME)
AC_DEFINE(PROTOTYPES)
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;) ]
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`:
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
# 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
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
# 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
# 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
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
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
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" \
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)
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*
# 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*
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>
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>
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
# 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
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
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
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
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
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
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. */
; 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
# 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. */
; 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
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
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 ()
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
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*
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*
# 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*
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*
# 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*
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;
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
-
# ------------------------------------------------
# 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.
have_db=yes
support_mysql=yes
db_name=MySQL
+ DB_NAME=mysql
else
echo "$ac_t""no" 1>&6
# ------------------------------------------------
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.
have_db=yes
support_sqlite=yes
db_name=SQLite
+ DB_NAME=sqlite
else
echo "$ac_t""no" 1>&6
+
+
cat >> confdefs.h <<\EOF
#define PROTOTYPES 1
EOF
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
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
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) ;;
# 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
# 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*
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.
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
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
# 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
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
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
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
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
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
# 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. */
; 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
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
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
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
# -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. */
; 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
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
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
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
# 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. */
; 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
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
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
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
# 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. */
; 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
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
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
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
# 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
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
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
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*
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>
#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*
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
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
:
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')
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
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
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*
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*
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>
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
# 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
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
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
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
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
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
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>
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>
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
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>
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
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>
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
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>
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
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>
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
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>
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
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. */
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
# 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>
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
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() {
; 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
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*
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*
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*
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*
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
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*
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>
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
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() {
; 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
rm -rf conftest*
cat > conftest.$ac_ext <<EOF
-#line 5842 "configure"
+#line 5845 "configure"
#include "confdefs.h"
#include <signal.h>
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
rm -rf conftest*
cat > conftest.$ac_ext <<EOF
-#line 5861 "configure"
+#line 5864 "configure"
#include "confdefs.h"
#include <signal.h>
; 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
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
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
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
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
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
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
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
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
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
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
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
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>
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
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>
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
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>
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
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() {
; 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
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
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()
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
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
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()
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
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
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()
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
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
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()
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
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
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()
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
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
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()
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
# 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
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
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
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
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
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
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
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
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
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() {
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
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() {
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
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. */
; 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
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. */
; 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
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. */
; 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
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. */
; 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
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. */
; 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
# 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. */
; 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
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
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
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
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
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
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
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
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
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
# 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. */
; 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
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
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
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
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
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
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
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. */
; 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
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
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
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
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. */
; 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
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. */
; 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
# 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
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__
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
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
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. */
; 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
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
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 8110 "configure"
+#line 8113 "configure"
#include "confdefs.h"
find_stack_direction ()
{
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
# 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
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
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
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
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
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
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
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
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
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. */
; 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
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
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
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
{ 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
}
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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. */
; 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
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
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
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
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`:
# 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*"
#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)
$(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:
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 */
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;
}
#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>
*/
typedef struct s_db {
BQUEUE bq; /* queue control */
-/* pthread_mutex_t mutex; */
brwlock_t lock; /* transaction lock */
struct sqlite *db;
char **result;
#ifdef HAVE_MYSQL
-#define BDB_VERSION 1
+#define BDB_VERSION 2
#include <mysql.h>
*/
typedef struct s_db {
BQUEUE bq; /* queue control */
-/* pthread_mutex_t mutex; */
brwlock_t lock; /* transaction lock */
MYSQL mysql;
MYSQL *db;
JobId_t JobId;
uint32_t FilenameId;
uint32_t PathId;
+ JobId_t MarkId;
char LStat[256];
/* int Status; */
char MD5[50];
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 */
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 */
--- /dev/null
+#!/bin/sh
+#
+# shell script to create Bacula database(s)
+#
+# Nothing to do
#
# 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
--- /dev/null
+#!/bin/sh
+#
+# shell script to create Bacula database(s)
+#
+# Nothing to do
--- /dev/null
+#!/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
--- /dev/null
+#!/bin/sh
+#
+# shell script to create Bacula tables
+#
+# Nothing to do -- created by Bacula
+#
#!/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
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),
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,
);
-- 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 (
# 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."
#!/bin/sh
#
-# shell script to create Bacula tables
+# shell script to create Bacula SQLite tables
bindir=@SQL_BINDIR@
cd @working_dir@
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)
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,
);
-- 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
* 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;
}
char buf[2000], ewc[30];
if (mdb->result == NULL) {
+ send(ctx, _("No results to list.\n"));
return;
}
/* determine column display widths */
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);
/* 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 */
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 */
time_t stime;
struct tm tm;
int stat;
- char *JobId;
+ char JobId[30];
btime_t JobTDate;
char ed1[30];
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;
}
/*
- * 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;
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;
}
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);
}
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);
}
/* 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;
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;
}
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);
/*
* 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;
}
char buf[2000], ewc[30];
if (mdb->result == NULL || mdb->nrow == 0) {
+ send(ctx, _("No results to list.\n"));
return;
}
/* determine column display widths */
static BSOCK *UA_sock = NULL;
static DIRRES *dir;
static FILE *output = stdout;
+static int stop = FALSE;
#define CONFIG_FILE "./console.conf" /* default configuration file */
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 = "*";
}
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) {
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();
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 */
return -1; /* error */
default:
len = sizeof_pool_memory(sock->msg) - 1;
+ if (stop) {
+ goto again;
+ }
if (fgets(sock->msg, len, input) == NULL) {
return -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
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;
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
*/
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) {
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);
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);
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);
}
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
* 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;
}
/*
}
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;
}
/*
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;
+
}
/*
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;
}
db_strerror(jcr->db));
}
-
msg_type = M_INFO; /* by default INFO message */
switch (TermCode) {
case JS_Terminated:
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";
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");
}
&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
*/
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);
{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[];
{"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}
};
{"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}
};
#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[] = {
{"signature", FS_KW_SIGNATURE},
{"encryption", FS_KW_ENCRYPTION},
{"verify", FS_KW_VERIFY},
+ {"onefs", FS_KW_ONEFS},
+ {"recurse", FS_KW_RECURSE},
{NULL, 0}
};
{"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}
};
#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
};
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
*
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 */
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;
};
}
Dmsg0(50, "DB opened\n");
-
/*
* Create Job record
*/
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 */
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;
}
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));
}
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);
+}
/* 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 */
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);
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);
/* 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);
{ 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")},
default:
break;
}
+ bsendmsg(ua, _("Pool %s created.\n"), pool->hdr.name);
return 1;
}
}
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);
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");
}
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;
}
/* 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);
/*
- * 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 "
/*
* 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;
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)) {
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)) {
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));
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++) {
* 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;
*/
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));
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));
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);
/*
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) {
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 */
}
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"));
} 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)) {
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;
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) {
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: "))) {
}
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);
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));
}
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);
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
char *level;
BSOCK *fd;
JOB_DBR jr;
- int last_full_id;
+ JobId_t JobId;
if (!get_or_create_client_record(jcr)) {
goto bail_out;
* 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;
}
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");
}
/*
- * 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:
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:
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:
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);
/*
* 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;
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;
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\
* 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
} 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 */
/*
* 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
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) {
#
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@
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 */
me += 1000000;
#endif
+ set_thread_concurrency(10);
+
start_watchdog(); /* start watchdog thread */
/* Become server, and handle requests */
&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;
}
{
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;
}
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);
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;
}
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;
}
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;
}
/* 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;
}
}
static int verify_cmd(JCR *jcr)
{
BSOCK *dir = jcr->dir_bsock;
+ BSOCK *sd = jcr->store_bsock;
char level[100];
jcr->JobType = JT_VERIFY;
} 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);
static int send_bootstrap_file(JCR *jcr)
{
FILE *bs;
- char buf[1000];
+ char buf[2000];
BSOCK *sd = jcr->store_bsock;
char *bootstrap = "bootstrap\n";
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);
/*
* 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
*/
/*
* 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)) {
}
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;
/* 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 */
BSOCK *sd, *dir;
JCR *jcr = (JCR *)pkt;
+ if (job_cancelled(jcr)) {
+ return 0;
+ }
+
sd = jcr->store_bsock;
dir = jcr->dir_bsock;
--- /dev/null
+/*
+ * 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
#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 {
/*
+ 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.
*/
#endif
-/* ****FIXME**** debug until stable */
-#undef bmalloc
-#define bmalloc(x) sm_malloc(__FILE__, __LINE__, x)
-
-
/*
* Structure for keeping track of hard linked files
*/
* 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;
}
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++) {
} else {
ff->no_recursion = 0;
}
+ if (inc->options & OPT_multifs) {
+ ff->one_file_system = 0;
+ } else {
+ ff->one_file_system = 1;
+ }
}
return inc;
}
#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 */
#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);
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 */
&& 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
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)
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;
}
}
--- /dev/null
+/*
+ * 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);
+ }
+
+}
#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 */
+
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";
level = -level;
}
-/* printf("level=%d debug=%d fmt=%s\n", level, debug_level, fmt); */
-
if (level <= debug_level) {
#ifdef FULL_LOCATION
if (details) {
va_list arg_ptr;
int i, len;
JCR *jcr = (JCR *) vjcr;
- int typesave = type;
MSGS *msgs;
char *job;
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);
va_end(arg_ptr);
}
-#ifdef DEBUG
char *res_to_str(int rcode)
{
if (rcode < r_first || rcode > r_last) {
return resources[rcode-r_first].name;
}
}
-#endif /* DEBUG */
/*
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"),
ok = FALSE;
break;
}
- if (n == 0) { /* End of conversation */
+ if (n == 0 || job_cancelled(jcr)) {
break; /* all done */
}
sm_check(__FILE__, __LINE__, False);
*/
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;
break;
}
}
- ASSERT(dsmsg == ds->msg);
- ASSERT(dsmsg == rec.data);
sm_check(__FILE__, __LINE__, False);
}
if (n < 0) {
}
/* 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;
}
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 ";
/* 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";
&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;
}
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,
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");
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);
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);
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 */
}
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) {
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;
}
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 */
}
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) {
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);
}
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);
}
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, */
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)
} 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);
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;
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);
}
}
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);
}
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);
}
argv += optind;
if (!argc && !default_tape) {
- Dmsg0(0, "No archive name specified\n");
+ Pmsg0(0, "No archive name specified\n");
usage();
}
* 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);
}
* 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);
}
* 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);
}
argv += optind;
if (argc != 1) {
- Dmsg0(0, "Wrong number of arguments: \n");
+ Pmsg0(0, "Wrong number of arguments: \n");
usage();
}
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)
}
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;
}
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;
} 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);
}
}
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. !!!
+ * !!! !!!
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
*/
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;
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;
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;
}
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");
}
}
int found = 0;
if (!dev) {
- Dmsg0(0, "No device: Use device command.\n");
+ Pmsg0(0, "No device: Use device command.\n");
return;
}
}
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;
}
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");
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;
}
}
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;
}
{
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));
}
/*
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));
}
/*
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);
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));
}
}
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
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");
}
}
{
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");
}
}
{
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");
}
}
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 ? "" : "!");
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);
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);
}
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");
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");
// 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");
}
{
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()
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
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);
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);
}
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");
}
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);
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);
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);
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
break;
}
if (!found)
- Dmsg1(0, "%s is an illegal command\n", cmd);
+ Pmsg1(0, "%s is an illegal command\n", cmd);
if (quit)
break;
}
*
* 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).
*
*/
/*
- * 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
int
open_dev(DEVICE *dev, char *VolName, int mode)
{
- char *archive_name;
+ POOLMEM *archive_name;
if (dev->state & ST_OPENED) {
/*
}
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, "/");
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 */
dev->use_count--;
}
+/*
+ * Used when unmounting the device
+ */
void force_close_dev(DEVICE *dev)
{
if (!dev) {
/* 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 */
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 */
*/
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 */
}
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 */
}
} 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));
} 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));
}
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);
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;
}
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);
}
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);
}
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 {
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);
dbl = debug_level;
debug_level = 1;
- Dmsg11(-1, "\nVolume Label:\n\
+ Pmsg11(-1, "\nVolume Label:\n\
Id : %s\
VerNo : %d\n\
VolName : %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;
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\
label.JobName, label.ClientName);
if (label.VerNum >= 10) {
- Dmsg4(-1, "\
+ Pmsg4(-1, "\
Job (unique name) : %s\n\
FileSet : %s\n\
JobType : %c\n\
}
if (rec->FileIndex == EOS_LABEL) {
- Dmsg7(-1, "\
+ Pmsg7(-1, "\
JobFiles : %s\n\
JobBytes : %s\n\
StartBlock : %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);
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;
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);
/*********************************************************************
if (!match_job_level(bsr->JobLevel, sessrec)) {
return 0;
}
+ if (!match_stream(bsr->stream, rec)) {
+ return 0;
+ }
return 1;
}
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)
{
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;
{"include", store_include},
{"exclude", store_exclude},
{"volfile", store_volfile},
+ {"stream", store_stream},
+ {"slot", store_slot},
{NULL, NULL}
};
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);
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;
}
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;
}
UnlockRes();
device = NULL;
+ set_thread_concurrency(me->max_concurrent_jobs * 2 +
+ 4 /* watch dog + servers + misc */);
+
start_watchdog(); /* start watchdog thread */
/*
*/
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));
{"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},
{"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}
};
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);
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) {
*/
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) {
*/
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;
}
/* 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);
}
}
}
/* */
-#define VERSION "1.22"
+#define VERSION "1.23"
#define VSTRING "1"
#define DATE "7 July 2002"
#define LSMDATE "07Jul02"