From: Kern Sibbald Date: Tue, 14 Jan 2003 16:41:21 +0000 (+0000) Subject: JobStatus updates X-Git-Tag: Release-1.29~32 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=77872001e134a70e0c295ce6f22d944d74accc33;p=bacula%2Fbacula JobStatus updates git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@288 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/autoconf/acconfig.h b/bacula/autoconf/acconfig.h index 250f8b7a8f..87d1815c78 100644 --- a/bacula/autoconf/acconfig.h +++ b/bacula/autoconf/acconfig.h @@ -26,7 +26,6 @@ /* Define if you want to use embedded MySQL */ #undef HAVE_EMBEDDED_MYSQL - /* Define if you want to use SQLite */ #undef HAVE_SQLITE @@ -198,3 +197,4 @@ #undef HAVE_INET_PTON +#undef HAVE_BIGENDIAN diff --git a/bacula/autoconf/config.h.in b/bacula/autoconf/config.h.in index 667c89f355..b5bf67c9d1 100644 --- a/bacula/autoconf/config.h.in +++ b/bacula/autoconf/config.h.in @@ -27,7 +27,6 @@ /* Define if you want to use embedded MySQL */ #undef HAVE_EMBEDDED_MYSQL - /* Define if you want to use SQLite */ #undef HAVE_SQLITE @@ -275,6 +274,9 @@ #undef HAVE_INET_PTON + +#undef HAVE_BIGENDIAN + /* The number of bytes in a char. */ #undef SIZEOF_CHAR diff --git a/bacula/autoconf/configure.in b/bacula/autoconf/configure.in index e7172e0603..deb101adde 100644 --- a/bacula/autoconf/configure.in +++ b/bacula/autoconf/configure.in @@ -791,10 +791,9 @@ AC_STRUCT_ST_BLKSIZE AC_STRUCT_ST_BLOCKS AC_STRUCT_TIMEZONE -# It seems that that many machines where seems to be -# broken just require something like -D_XXX_SOURCE, where XXX might -# be POSIX, POSIX_C, ALL, HPUX or whatever, depending on the machine. - +dnl# -------------------------------------------------------------------------- +dnl# Check for utime.h structure +dnl# -------------------------------------------------------------------------- AC_CACHE_CHECK(for utime.h, tar_cv_header_utime_h, [AC_TRY_COMPILE([ #include @@ -802,6 +801,18 @@ AC_CACHE_CHECK(for utime.h, tar_cv_header_utime_h, tar_cv_header_utime_h=yes, tar_cv_header_utime_h=no)]) test $tar_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H) +dnl# -------------------------------------------------------------------------- +dnl# Check for bigendian +dnl# -------------------------------------------------------------------------- +AC_CACHE_CHECK([for bigendian], ba_cv_bigendian, + [AC_TRY_RUN( + [main(){long a=1L; char *p=(char *)&a; exit(*p);}], + [ba_cv_bigendian=yes], + [ba_cv_bigendian=no], + [ba_cv_bigendian=no])]) +test $ba_cv_bigendian = yes && AC_DEFINE(HAVE_BIGENDIAN) + + AC_C_CONST diff --git a/bacula/configure b/bacula/configure index a62ae40943..5b2d2c2b9b 100755 --- a/bacula/configure +++ b/bacula/configure @@ -5855,17 +5855,13 @@ EOF fi -# It seems that that many machines where seems to be -# broken just require something like -D_XXX_SOURCE, where XXX might -# 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:5864: checking for utime.h" >&5 +echo "configure:5860: 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 < @@ -5874,7 +5870,7 @@ int main() { struct utimbuf foo ; return 0; } EOF -if { (eval echo configure:5878: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5874: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tar_cv_header_utime_h=yes else @@ -5892,13 +5888,47 @@ test $tar_cv_header_utime_h = yes && cat >> confdefs.h <<\EOF EOF +echo $ac_n "checking for bigendian""... $ac_c" 1>&6 +echo "configure:5893: checking for bigendian" >&5 +if eval "test \"`echo '$''{'ba_cv_bigendian'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + ba_cv_bigendian=no +else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + ba_cv_bigendian=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ba_cv_bigendian=no +fi +rm -fr conftest* +fi + +fi + +echo "$ac_t""$ba_cv_bigendian" 1>&6 +test $ba_cv_bigendian = yes && cat >> confdefs.h <<\EOF +#define HAVE_BIGENDIAN 1 +EOF + + + echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:5897: checking for working const" >&5 +echo "configure:5927: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5981: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -5970,17 +6000,17 @@ fi echo $ac_n "checking how to get filesystem type""... $ac_c" 1>&6 -echo "configure:5974: checking how to get filesystem type" >&5 +echo "configure:6004: checking how to get filesystem type" >&5 fstype=no # The order of these tests is important. cat > conftest.$ac_ext < #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5984: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6014: \"$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* @@ -5996,13 +6026,13 @@ fi rm -f conftest* if test $fstype = no; then cat > conftest.$ac_ext < #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6006: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6036: \"$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* @@ -6019,13 +6049,13 @@ rm -f conftest* fi if test $fstype = no; then cat > conftest.$ac_ext < #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6029: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6059: \"$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* @@ -6042,12 +6072,12 @@ rm -f conftest* fi if test $fstype = no; then cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6051: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6081: \"$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* @@ -6064,7 +6094,7 @@ rm -f conftest* fi if test $fstype = no; then cat > conftest.$ac_ext < EOF @@ -6081,13 +6111,13 @@ rm -f conftest* fi if test $fstype = no; then cat > conftest.$ac_ext < #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:6091: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6121: \"$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* @@ -6105,12 +6135,12 @@ fi echo "$ac_t""$fstype" 1>&6 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:6109: checking return type of signal handlers" >&5 +echo "configure:6139: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -6127,7 +6157,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:6131: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6161: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -6147,13 +6177,13 @@ EOF echo $ac_n "checking for type of signal functions""... $ac_c" 1>&6 -echo "configure:6151: checking for type of signal functions" >&5 +echo "configure:6181: checking for type of signal functions" >&5 if eval "test \"`echo '$''{'bash_cv_signal_vintage'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { @@ -6166,7 +6196,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:6170: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6200: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* bash_cv_signal_vintage=posix else @@ -6175,7 +6205,7 @@ else rm -rf conftest* cat > conftest.$ac_ext < int main() { @@ -6185,7 +6215,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:6189: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6219: \"$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 @@ -6194,7 +6224,7 @@ else rm -rf conftest* cat > conftest.$ac_ext < @@ -6207,7 +6237,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:6211: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:6241: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* bash_cv_signal_vintage=svr3 else @@ -6246,12 +6276,12 @@ EOF fi echo $ac_n "checking for mode_t""... $ac_c" 1>&6 -echo "configure:6250: checking for mode_t" >&5 +echo "configure:6280: checking for mode_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -6279,12 +6309,12 @@ EOF fi echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:6283: checking for uid_t in sys/types.h" >&5 +echo "configure:6313: 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 @@ -6313,12 +6343,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:6317: checking for size_t" >&5 +echo "configure:6347: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -6346,12 +6376,12 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:6350: checking for pid_t" >&5 +echo "configure:6380: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -6379,12 +6409,12 @@ EOF fi echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:6383: checking for off_t" >&5 +echo "configure:6413: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -6412,12 +6442,12 @@ EOF fi echo $ac_n "checking for ino_t""... $ac_c" 1>&6 -echo "configure:6416: checking for ino_t" >&5 +echo "configure:6446: checking for ino_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_ino_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -6445,12 +6475,12 @@ EOF fi echo $ac_n "checking for dev_t""... $ac_c" 1>&6 -echo "configure:6449: checking for dev_t" >&5 +echo "configure:6479: checking for dev_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_dev_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -6478,12 +6508,12 @@ EOF fi echo $ac_n "checking for daddr_t""... $ac_c" 1>&6 -echo "configure:6482: checking for daddr_t" >&5 +echo "configure:6512: checking for daddr_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_daddr_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -6511,12 +6541,12 @@ EOF fi echo $ac_n "checking for major_t""... $ac_c" 1>&6 -echo "configure:6515: checking for major_t" >&5 +echo "configure:6545: checking for major_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_major_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -6544,12 +6574,12 @@ EOF fi echo $ac_n "checking for minor_t""... $ac_c" 1>&6 -echo "configure:6548: checking for minor_t" >&5 +echo "configure:6578: checking for minor_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_minor_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -6577,12 +6607,12 @@ EOF fi echo $ac_n "checking for ssize_t""... $ac_c" 1>&6 -echo "configure:6581: checking for ssize_t" >&5 +echo "configure:6611: checking for ssize_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -6610,12 +6640,12 @@ EOF fi echo $ac_n "checking for st_blocks in struct stat""... $ac_c" 1>&6 -echo "configure:6614: checking for st_blocks in struct stat" >&5 +echo "configure:6644: checking for st_blocks in struct stat" >&5 if eval "test \"`echo '$''{'ac_cv_struct_st_blocks'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -6623,7 +6653,7 @@ int main() { struct stat s; s.st_blocks; ; return 0; } EOF -if { (eval echo configure:6627: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6657: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_blocks=yes else @@ -6646,12 +6676,12 @@ else fi echo $ac_n "checking for st_rdev in struct stat""... $ac_c" 1>&6 -echo "configure:6650: checking for st_rdev in struct stat" >&5 +echo "configure:6680: checking for st_rdev in struct stat" >&5 if eval "test \"`echo '$''{'ac_cv_struct_st_rdev'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -6659,7 +6689,7 @@ int main() { struct stat s; s.st_rdev; ; return 0; } EOF -if { (eval echo configure:6663: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6693: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_rdev=yes else @@ -6680,12 +6710,12 @@ EOF fi echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 -echo "configure:6684: checking whether struct tm is in sys/time.h or time.h" >&5 +echo "configure:6714: checking whether struct tm is in sys/time.h or time.h" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -6693,7 +6723,7 @@ int main() { struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:6697: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6727: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -6714,12 +6744,12 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:6718: checking for working const" >&5 +echo "configure:6748: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6802: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -6791,7 +6821,7 @@ fi echo $ac_n "checking size of char""... $ac_c" 1>&6 -echo "configure:6795: checking size of char" >&5 +echo "configure:6825: 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 @@ -6799,7 +6829,7 @@ else ac_cv_sizeof_char=1 else cat > conftest.$ac_ext < int main() @@ -6810,7 +6840,7 @@ int main() return(0); } EOF -if { (eval echo configure:6814: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6844: \"$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 @@ -6830,7 +6860,7 @@ EOF echo $ac_n "checking size of short int""... $ac_c" 1>&6 -echo "configure:6834: checking size of short int" >&5 +echo "configure:6864: 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 @@ -6838,7 +6868,7 @@ else ac_cv_sizeof_short_int=2 else cat > conftest.$ac_ext < int main() @@ -6849,7 +6879,7 @@ int main() return(0); } EOF -if { (eval echo configure:6853: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6883: \"$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 @@ -6869,7 +6899,7 @@ EOF echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:6873: checking size of int" >&5 +echo "configure:6903: 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 @@ -6877,7 +6907,7 @@ else ac_cv_sizeof_int=4 else cat > conftest.$ac_ext < int main() @@ -6888,7 +6918,7 @@ int main() return(0); } EOF -if { (eval echo configure:6892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6922: \"$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 @@ -6908,7 +6938,7 @@ EOF echo $ac_n "checking size of long int""... $ac_c" 1>&6 -echo "configure:6912: checking size of long int" >&5 +echo "configure:6942: 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 @@ -6916,7 +6946,7 @@ else ac_cv_sizeof_long_int=4 else cat > conftest.$ac_ext < int main() @@ -6927,7 +6957,7 @@ int main() return(0); } EOF -if { (eval echo configure:6931: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6961: \"$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 @@ -6947,7 +6977,7 @@ EOF echo $ac_n "checking size of long long int""... $ac_c" 1>&6 -echo "configure:6951: checking size of long long int" >&5 +echo "configure:6981: 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 @@ -6955,7 +6985,7 @@ else ac_cv_sizeof_long_long_int=8 else cat > conftest.$ac_ext < int main() @@ -6966,7 +6996,7 @@ int main() return(0); } EOF -if { (eval echo configure:6970: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7000: \"$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 @@ -6986,7 +7016,7 @@ EOF echo $ac_n "checking size of int *""... $ac_c" 1>&6 -echo "configure:6990: checking size of int *" >&5 +echo "configure:7020: 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 @@ -6994,7 +7024,7 @@ else ac_cv_sizeof_int_p=4 else cat > conftest.$ac_ext < int main() @@ -7005,7 +7035,7 @@ int main() return(0); } EOF -if { (eval echo configure:7009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:7039: \"$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 @@ -7027,20 +7057,20 @@ EOF # Check for sys/types.h types echo $ac_n "checking for u_int type""... $ac_c" 1>&6 -echo "configure:7031: checking for u_int type" >&5 +echo "configure:7061: checking for u_int type" >&5 if eval "test \"`echo '$''{'ac_cv_have_u_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { u_int a; a = 1; ; return 0; } EOF -if { (eval echo configure:7044: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7074: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_u_int="yes" else @@ -7064,20 +7094,20 @@ EOF fi echo $ac_n "checking for intmax_t type""... $ac_c" 1>&6 -echo "configure:7068: checking for intmax_t type" >&5 +echo "configure:7098: checking for intmax_t type" >&5 if eval "test \"`echo '$''{'ac_cv_have_intmax_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { intmax_t a; a = 1; ; return 0; } EOF -if { (eval echo configure:7081: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7111: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_intmax_t="yes" else @@ -7086,14 +7116,14 @@ else rm -rf conftest* cat > conftest.$ac_ext < int main() { intmax_t a; a = 1; ; return 0; } EOF -if { (eval echo configure:7097: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7127: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_intmax_t="yes" else @@ -7123,20 +7153,20 @@ fi echo $ac_n "checking for u_intmax_t type""... $ac_c" 1>&6 -echo "configure:7127: checking for u_intmax_t type" >&5 +echo "configure:7157: checking for u_intmax_t type" >&5 if eval "test \"`echo '$''{'ac_cv_have_u_intmax_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { u_intmax_t a; a = 1; ; return 0; } EOF -if { (eval echo configure:7140: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7170: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_u_intmax_t="yes" else @@ -7145,14 +7175,14 @@ else rm -rf conftest* cat > conftest.$ac_ext < int main() { u_intmax_t a; a = 1; ; return 0; } EOF -if { (eval echo configure:7156: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7186: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_u_intmax_t="yes" else @@ -7181,20 +7211,20 @@ fi echo $ac_n "checking for intXX_t types""... $ac_c" 1>&6 -echo "configure:7185: checking for intXX_t types" >&5 +echo "configure:7215: checking for intXX_t types" >&5 if eval "test \"`echo '$''{'ac_cv_have_intxx_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { int8_t a; int16_t b; int32_t c; a = b = c = 1; ; return 0; } EOF -if { (eval echo configure:7198: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7228: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_intxx_t="yes" else @@ -7218,20 +7248,20 @@ EOF fi echo $ac_n "checking for int64_t type""... $ac_c" 1>&6 -echo "configure:7222: checking for int64_t type" >&5 +echo "configure:7252: checking for int64_t type" >&5 if eval "test \"`echo '$''{'ac_cv_have_int64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { int64_t a; a = 1; ; return 0; } EOF -if { (eval echo configure:7235: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7265: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_int64_t="yes" else @@ -7255,20 +7285,20 @@ EOF fi echo $ac_n "checking for u_intXX_t types""... $ac_c" 1>&6 -echo "configure:7259: checking for u_intXX_t types" >&5 +echo "configure:7289: checking for u_intXX_t types" >&5 if eval "test \"`echo '$''{'ac_cv_have_u_intxx_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1; ; return 0; } EOF -if { (eval echo configure:7272: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7302: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_u_intxx_t="yes" else @@ -7292,20 +7322,20 @@ EOF fi echo $ac_n "checking for u_int64_t types""... $ac_c" 1>&6 -echo "configure:7296: checking for u_int64_t types" >&5 +echo "configure:7326: checking for u_int64_t types" >&5 if eval "test \"`echo '$''{'ac_cv_have_u_int64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { u_int64_t a; a = 1; ; return 0; } EOF -if { (eval echo configure:7309: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7339: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_u_int64_t="yes" else @@ -7332,9 +7362,9 @@ if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \ test "x$ac_cv_header_sys_bitypes_h" = "xyes") then echo $ac_n "checking for intXX_t and u_intXX_t types in sys/bitypes.h""... $ac_c" 1>&6 -echo "configure:7336: checking for intXX_t and u_intXX_t types in sys/bitypes.h" >&5 +echo "configure:7366: checking for intXX_t and u_intXX_t types in sys/bitypes.h" >&5 cat > conftest.$ac_ext < int main() { @@ -7343,7 +7373,7 @@ int main() { a = b = c = e = f = g = 1; ; return 0; } EOF -if { (eval echo configure:7347: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7377: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_U_INTXX_T 1 @@ -7370,13 +7400,13 @@ fi if test -z "$have_u_intxx_t" ; then echo $ac_n "checking for uintXX_t types""... $ac_c" 1>&6 -echo "configure:7374: checking for uintXX_t types" >&5 +echo "configure:7404: checking for uintXX_t types" >&5 if eval "test \"`echo '$''{'ac_cv_have_uintxx_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { @@ -7384,7 +7414,7 @@ int main() { uint32_t c; a = b = c = 1; ; return 0; } EOF -if { (eval echo configure:7388: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:7418: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_have_uintxx_t="yes" else @@ -7425,12 +7455,12 @@ for ac_func in \ do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7429: checking for $ac_func" >&5 +echo "configure:7459: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7487: \"$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 @@ -7483,12 +7513,12 @@ done for ac_func in fchdir do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7487: checking for $ac_func" >&5 +echo "configure:7517: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7545: \"$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 @@ -7542,12 +7572,12 @@ done for ac_func in snprintf vsnprintf gethostid getdomainname do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7546: checking for $ac_func" >&5 +echo "configure:7576: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7604: \"$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 @@ -7598,12 +7628,12 @@ done for ac_func in localtime_r readdir_r strerror_r gethostbyname_r do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7602: checking for $ac_func" >&5 +echo "configure:7632: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7653,12 +7683,12 @@ done # If resolver functions are not in libc check for -lnsl or -lresolv. echo $ac_n "checking for gethostbyname_r""... $ac_c" 1>&6 -echo "configure:7657: checking for gethostbyname_r" >&5 +echo "configure:7687: checking for gethostbyname_r" >&5 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname_r'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gethostbyname_r=yes" else @@ -7699,7 +7729,7 @@ if eval "test \"`echo '$ac_cv_func_'gethostbyname_r`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for gethostbyname_r in -lnsl""... $ac_c" 1>&6 -echo "configure:7703: checking for gethostbyname_r in -lnsl" >&5 +echo "configure:7733: checking for gethostbyname_r in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname_r | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7707,7 +7737,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7752: \"$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 @@ -7746,7 +7776,7 @@ else fi echo $ac_n "checking for gethostbyname_r in -lresolv""... $ac_c" 1>&6 -echo "configure:7750: checking for gethostbyname_r in -lresolv" >&5 +echo "configure:7780: checking for gethostbyname_r in -lresolv" >&5 ac_lib_var=`echo resolv'_'gethostbyname_r | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7754,7 +7784,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lresolv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7799: \"$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 @@ -7798,12 +7828,12 @@ fi # Find where sockets are (especially for Solaris) echo $ac_n "checking for socket""... $ac_c" 1>&6 -echo "configure:7802: checking for socket" >&5 +echo "configure:7832: checking for socket" >&5 if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7860: \"$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 @@ -7844,7 +7874,7 @@ if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for socket in -lxnet""... $ac_c" 1>&6 -echo "configure:7848: checking for socket in -lxnet" >&5 +echo "configure:7878: 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 @@ -7852,7 +7882,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lxnet $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7897: \"$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 @@ -7891,7 +7921,7 @@ else fi echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6 -echo "configure:7895: checking for socket in -lsocket" >&5 +echo "configure:7925: 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 @@ -7899,7 +7929,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7944: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7938,7 +7968,7 @@ else fi echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6 -echo "configure:7942: checking for socket in -linet" >&5 +echo "configure:7972: 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 @@ -7946,7 +7976,7 @@ else ac_save_LIBS="$LIBS" LIBS="-linet $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7990,12 +8020,12 @@ fi for ac_func in inet_pton do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7994: checking for $ac_func" >&5 +echo "configure:8024: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8052: \"$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 @@ -8047,12 +8077,12 @@ done echo $ac_n "checking for strftime""... $ac_c" 1>&6 -echo "configure:8051: checking for strftime" >&5 +echo "configure:8081: checking for strftime" >&5 if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8109: \"$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 @@ -8097,7 +8127,7 @@ else echo "$ac_t""no" 1>&6 # strftime is in -lintl on SCO UNIX. echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6 -echo "configure:8101: checking for strftime in -lintl" >&5 +echo "configure:8131: 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 @@ -8105,7 +8135,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8150: \"$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 @@ -8143,12 +8173,12 @@ fi fi echo $ac_n "checking for vprintf""... $ac_c" 1>&6 -echo "configure:8147: checking for vprintf" >&5 +echo "configure:8177: checking for vprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8205: \"$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 @@ -8195,12 +8225,12 @@ fi if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:8199: checking for _doprnt" >&5 +echo "configure:8229: checking for _doprnt" >&5 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8257: \"$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 @@ -8250,19 +8280,19 @@ fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:8254: checking for working alloca.h" >&5 +echo "configure:8284: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:8266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8296: \"$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 @@ -8283,12 +8313,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:8287: checking for alloca" >&5 +echo "configure:8317: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8350: \"$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 @@ -8348,12 +8378,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:8352: checking whether alloca needs Cray hooks" >&5 +echo "configure:8382: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:8382: checking for $ac_func" >&5 +echo "configure:8412: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8440: \"$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 @@ -8433,7 +8463,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:8437: checking stack direction for C alloca" >&5 +echo "configure:8467: 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 @@ -8441,7 +8471,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8494: \"$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 @@ -8483,7 +8513,7 @@ fi # getmntent is in -lsun on Irix 4, -lseq on Dynix/PTX, -lgen on Unixware. echo $ac_n "checking for getmntent in -lsun""... $ac_c" 1>&6 -echo "configure:8487: checking for getmntent in -lsun" >&5 +echo "configure:8517: 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 @@ -8491,7 +8521,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsun $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8536: \"$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 @@ -8521,7 +8551,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for getmntent in -lseq""... $ac_c" 1>&6 -echo "configure:8525: checking for getmntent in -lseq" >&5 +echo "configure:8555: 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 @@ -8529,7 +8559,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lseq $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8574: \"$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 @@ -8559,7 +8589,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for getmntent in -lgen""... $ac_c" 1>&6 -echo "configure:8563: checking for getmntent in -lgen" >&5 +echo "configure:8593: 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 @@ -8567,7 +8597,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgen $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure: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 @@ -8603,12 +8633,12 @@ fi fi echo $ac_n "checking for getmntent""... $ac_c" 1>&6 -echo "configure:8607: checking for getmntent" >&5 +echo "configure:8637: checking for getmntent" >&5 if eval "test \"`echo '$''{'ac_cv_func_getmntent'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8665: \"$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 @@ -8654,7 +8684,7 @@ else fi echo $ac_n "checking whether closedir returns void""... $ac_c" 1>&6 -echo "configure:8658: checking whether closedir returns void" >&5 +echo "configure:8688: 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 @@ -8662,13 +8692,13 @@ else ac_cv_func_closedir_void=yes else cat > conftest.$ac_ext < #include <$ac_header_dirent> int closedir(); main() { exit(closedir(opendir(".")) != 0); } EOF -if { (eval echo configure:8672: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8702: \"$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 @@ -8691,7 +8721,7 @@ EOF fi echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6 -echo "configure:8695: checking whether setpgrp takes no argument" >&5 +echo "configure:8725: 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 @@ -8699,7 +8729,7 @@ else { echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8753: \"$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 @@ -8742,7 +8772,7 @@ EOF fi echo $ac_n "checking for working fnmatch""... $ac_c" 1>&6 -echo "configure:8746: checking for working fnmatch" >&5 +echo "configure:8776: 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 @@ -8753,11 +8783,11 @@ if test "$cross_compiling" = yes; then ac_cv_func_fnmatch_works=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8791: \"$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 @@ -8782,7 +8812,7 @@ fi echo $ac_n "checking for setlocale in -lxpg4""... $ac_c" 1>&6 -echo "configure:8786: checking for setlocale in -lxpg4" >&5 +echo "configure:8816: 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 @@ -8790,7 +8820,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lxpg4 $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8835: \"$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 @@ -8824,7 +8854,7 @@ fi echo $ac_n "checking for getpwnam in -lsun""... $ac_c" 1>&6 -echo "configure:8828: checking for getpwnam in -lsun" >&5 +echo "configure:8858: 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 @@ -8832,7 +8862,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsun $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8877: \"$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 @@ -8875,17 +8905,17 @@ for ac_hdr in zlib.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:8879: checking for $ac_hdr" >&5 +echo "configure:8909: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8889: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8919: \"$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* @@ -8912,7 +8942,7 @@ fi done echo $ac_n "checking for deflate in -lz""... $ac_c" 1>&6 -echo "configure:8916: checking for deflate in -lz" >&5 +echo "configure:8946: 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 @@ -8920,7 +8950,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lz $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8965: \"$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 @@ -8962,7 +8992,7 @@ fi PTHREAD_LIB="" echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 -echo "configure:8966: checking for pthread_create in -lpthread" >&5 +echo "configure:8996: 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 @@ -8970,7 +9000,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9015: \"$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 @@ -9000,7 +9030,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6 -echo "configure:9004: checking for pthread_create in -lpthreads" >&5 +echo "configure:9034: 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 @@ -9008,7 +9038,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthreads $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9053: \"$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 @@ -9038,7 +9068,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6 -echo "configure:9042: checking for pthread_create in -lc_r" >&5 +echo "configure:9072: 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 @@ -9046,7 +9076,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lc_r $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9091: \"$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 @@ -9076,12 +9106,12 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create""... $ac_c" 1>&6 -echo "configure:9080: checking for pthread_create" >&5 +echo "configure:9110: checking for pthread_create" >&5 if eval "test \"`echo '$''{'ac_cv_func_pthread_create'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9138: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_pthread_create=yes" else diff --git a/bacula/src/dird/backup.c b/bacula/src/dird/backup.c index 7b00d97c9a..27c165b9b9 100644 --- a/bacula/src/dird/backup.c +++ b/bacula/src/dird/backup.c @@ -18,7 +18,7 @@ */ /* - Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker + Copyright (C) 2000-2003 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 @@ -166,7 +166,7 @@ int do_backup(JCR *jcr) * */ Dmsg0(110, "Open connection with storage daemon\n"); - jcr->JobStatus = JS_Blocked; + set_jcr_job_status(jcr, JS_Blocked); /* * Start conversation with Storage daemon */ @@ -187,12 +187,12 @@ int do_backup(JCR *jcr) } Dmsg0(150, "Storage daemon connection OK\n"); - jcr->JobStatus = JS_Blocked; + set_jcr_job_status(jcr, JS_Blocked); if (!connect_to_file_daemon(jcr, 10, FDConnectTimeout, 1)) { goto bail_out; } - jcr->JobStatus = JS_Running; + set_jcr_job_status(jcr, JS_Running); fd = jcr->file_bsock; if (!send_include_list(jcr)) { @@ -270,12 +270,13 @@ static int wait_for_job_termination(JCR *jcr) BSOCK *fd = jcr->file_bsock; int fd_ok = FALSE; - jcr->JobStatus = JS_WaitFD; + set_jcr_job_status(jcr, JS_WaitFD); /* Wait for Client to terminate */ while ((n = bget_msg(fd, 0)) >= 0 && !job_cancelled(jcr)) { - if (sscanf(fd->msg, EndBackup, &jcr->JobStatus, &jcr->JobFiles, + if (sscanf(fd->msg, EndBackup, &jcr->FDJobStatus, &jcr->JobFiles, &jcr->ReadBytes, &jcr->JobBytes) == 4) { fd_ok = TRUE; + set_jcr_job_status(jcr, jcr->FDJobStatus); Dmsg1(100, "FDStatus=%c\n", (char)jcr->JobStatus); } } @@ -304,7 +305,7 @@ static void backup_cleanup(JCR *jcr, int TermCode, char *since) { char sdt[50], edt[50]; char ec1[30], ec2[30], ec3[30], compress[50]; - char term_code[100]; + char term_code[100], fd_term_msg[100], sd_term_msg[100]; char *term_msg; int msg_type; MEDIA_DBR mr; @@ -313,7 +314,7 @@ static void backup_cleanup(JCR *jcr, int TermCode, char *since) Dmsg0(100, "Enter backup_cleanup()\n"); memset(&mr, 0, sizeof(mr)); - jcr->JobStatus = TermCode; + set_jcr_job_status(jcr, TermCode); update_job_end_record(jcr); /* update database */ @@ -438,6 +439,8 @@ static void backup_cleanup(JCR *jcr, int TermCode, char *since) sprintf(compress, "%.1f %%", (float)compression); } } + jobstatus_to_ascii(jcr->FDJobStatus, fd_term_msg, sizeof(fd_term_msg)); + jobstatus_to_ascii(jcr->SDJobStatus, sd_term_msg, sizeof(sd_term_msg)); Jmsg(jcr, msg_type, 0, _("Bacula " VERSION " (" LSMDATE "): %s\n\ JobId: %d\n\ @@ -455,6 +458,8 @@ Volume names(s): %s\n\ Volume Session Id: %d\n\ Volume Session Time: %d\n\ Last Volume Bytes: %s\n\ +FD termination status: %s\n\ +SD termination status: %s\n\ Termination: %s\n\n"), edt, jcr->jr.JobId, @@ -472,6 +477,8 @@ Termination: %s\n\n"), jcr->VolSessionId, jcr->VolSessionTime, edit_uint64_with_commas(mr.VolBytes, ec3), + fd_term_msg, + sd_term_msg, term_msg); diff --git a/bacula/src/dird/fd_cmds.c b/bacula/src/dird/fd_cmds.c index a668d3c793..c44b15e63d 100644 --- a/bacula/src/dird/fd_cmds.c +++ b/bacula/src/dird/fd_cmds.c @@ -67,16 +67,16 @@ int connect_to_file_daemon(JCR *jcr, int retry_interval, int max_retry_time, _("File daemon"), jcr->client->address, NULL, jcr->client->FDport, verbose); if (fd == NULL) { - jcr->JobStatus = JS_ErrorTerminated; + set_jcr_job_status(jcr, JS_ErrorTerminated); return 0; } Dmsg0(10, "Opened connection with File daemon\n"); fd->res = (RES *)jcr->client; /* save resource in BSOCK */ jcr->file_bsock = fd; - jcr->JobStatus = JS_Running; + set_jcr_job_status(jcr, JS_Running); if (!authenticate_file_daemon(jcr)) { - jcr->JobStatus = JS_ErrorTerminated; + set_jcr_job_status(jcr, JS_ErrorTerminated); return 0; } @@ -90,7 +90,7 @@ int connect_to_file_daemon(JCR *jcr, int retry_interval, int max_retry_time, Dmsg1(110, "msg); if (strncmp(fd->msg, OKjob, strlen(OKjob)) != 0) { Jmsg(jcr, M_FATAL, 0, _("File daemon rejected Job command: %s\n"), fd->msg); - jcr->JobStatus = JS_ErrorTerminated; + set_jcr_job_status(jcr, JS_ErrorTerminated); return 0; } else { /***** ***FIXME***** update Client Uname */ @@ -98,7 +98,7 @@ int connect_to_file_daemon(JCR *jcr, int retry_interval, int max_retry_time, } else { Jmsg(jcr, M_FATAL, 0, _("JobStatus = JS_ErrorTerminated; + set_jcr_job_status(jcr, JS_ErrorTerminated); return 0; } return 1; @@ -199,7 +199,7 @@ int send_include_list(JCR *jcr) return 1; bail_out: - jcr->JobStatus = JS_ErrorTerminated; + set_jcr_job_status(jcr, JS_ErrorTerminated); return 0; } @@ -226,14 +226,14 @@ int send_exclude_list(JCR *jcr) fd->msg = fileset->exclude_array[i]; if (!bnet_send(fd)) { Jmsg(jcr, M_FATAL, 0, _(">filed: write error on socket\n")); - jcr->JobStatus = JS_ErrorTerminated; + set_jcr_job_status(jcr, JS_ErrorTerminated); return 0; } } bnet_sig(fd, BNET_EOD); fd->msg = msgsave; if (!response(fd, OKexc, "Exclude")) { - jcr->JobStatus = JS_ErrorTerminated; + set_jcr_job_status(jcr, JS_ErrorTerminated); return 0; } return 1; @@ -273,7 +273,7 @@ int get_attributes_and_put_in_catalog(JCR *jcr) if ((len = sscanf(fd->msg, "%ld %d %s", &file_index, &stream, Opts_MD5)) != 3) { Jmsg(jcr, M_FATAL, 0, _("msglen, fd->msg); - jcr->JobStatus = JS_ErrorTerminated; + set_jcr_job_status(jcr, JS_ErrorTerminated); return 0; } p = fd->msg; @@ -308,7 +308,7 @@ msglen=%d msg=%s\n"), len, fd->msglen, fd->msg); if (!db_create_file_attributes_record(jcr->db, &ar)) { Jmsg1(jcr, M_ERROR, 0, "%s", db_strerror(jcr->db)); - jcr->JobStatus = JS_Error; + set_jcr_job_status(jcr, JS_Error); continue; } jcr->FileId = ar.FileId; @@ -316,14 +316,14 @@ msglen=%d msg=%s\n"), len, fd->msglen, fd->msg); if (jcr->FileIndex != (uint32_t)file_index) { Jmsg2(jcr, M_ERROR, 0, _("MD5 index %d not same as attributes %d\n"), file_index, jcr->FileIndex); - jcr->JobStatus = JS_Error; + set_jcr_job_status(jcr, JS_Error); continue; } db_escape_string(MD5, Opts_MD5, strlen(Opts_MD5)); Dmsg2(120, "MD5len=%d MD5=%s\n", strlen(MD5), MD5); if (!db_add_MD5_to_file_record(jcr->db, jcr->FileId, MD5)) { Jmsg1(jcr, M_ERROR, 0, "%s", db_strerror(jcr->db)); - jcr->JobStatus = JS_Error; + set_jcr_job_status(jcr, JS_Error); } } jcr->jr.JobFiles = jcr->JobFiles = file_index; @@ -332,10 +332,10 @@ msglen=%d msg=%s\n"), len, fd->msglen, fd->msg); if (is_bnet_error(fd)) { Jmsg1(jcr, M_FATAL, 0, _("JobStatus = JS_ErrorTerminated; + set_jcr_job_status(jcr, JS_ErrorTerminated); return 0; } - jcr->JobStatus = JS_Terminated; + set_jcr_job_status(jcr, JS_Terminated); return 1; } diff --git a/bacula/src/dird/job.c b/bacula/src/dird/job.c index 68ed80a35a..00579eaf89 100644 --- a/bacula/src/dird/job.c +++ b/bacula/src/dird/job.c @@ -82,7 +82,7 @@ void run_job(JCR *jcr) /* Initialize termination condition variable */ if ((errstat = pthread_cond_init(&jcr->term_wait, NULL)) != 0) { Jmsg1(jcr, M_FATAL, 0, _("Unable to init job cond variable: ERR=%s\n"), strerror(errstat)); - jcr->JobStatus = JS_ErrorTerminated; + set_jcr_job_status(jcr, JS_ErrorTerminated); free_jcr(jcr); return; } @@ -96,7 +96,7 @@ void run_job(JCR *jcr) if (!db_open_database(jcr->db)) { Jmsg(jcr, M_FATAL, 0, "%s", db_strerror(jcr->db)); db_close_database(jcr->db); - jcr->JobStatus = JS_ErrorTerminated; + set_jcr_job_status(jcr, JS_ErrorTerminated); free_jcr(jcr); return; } @@ -109,7 +109,7 @@ void run_job(JCR *jcr) if (!db_create_job_record(jcr->db, &jcr->jr)) { Jmsg(jcr, M_FATAL, 0, "%s", db_strerror(jcr->db)); db_close_database(jcr->db); - jcr->JobStatus = JS_ErrorTerminated; + set_jcr_job_status(jcr, JS_ErrorTerminated); free_jcr(jcr); return; } @@ -145,12 +145,12 @@ static void job_thread(void *arg) if (jcr->job->MaxStartDelay != 0 && jcr->job->MaxStartDelay < (utime_t)(jcr->start_time - jcr->sched_time)) { Jmsg(jcr, M_FATAL, 0, _("Job cancelled because max delay time exceeded.\n")); - jcr->JobStatus = JS_ErrorTerminated; + set_jcr_job_status(jcr, JS_ErrorTerminated); update_job_end_record(jcr); } else { /* Run Job */ - jcr->JobStatus = JS_Running; + set_jcr_job_status(jcr, JS_Running); if (jcr->job->RunBeforeJob) { POOLMEM *before = get_pool_memory(PM_FNAME); @@ -182,7 +182,7 @@ static void job_thread(void *arg) case JT_ADMIN: /* No actual job */ do_autoprune(jcr); - jcr->JobStatus = JS_Terminated; + set_jcr_job_status(jcr, JS_Terminated); break; default: Pmsg1(0, "Unimplemented job type: %d\n", jcr->JobType); diff --git a/bacula/src/dird/msgchan.c b/bacula/src/dird/msgchan.c index deff677137..c8d7682961 100644 --- a/bacula/src/dird/msgchan.c +++ b/bacula/src/dird/msgchan.c @@ -16,7 +16,7 @@ * Version $Id$ */ /* - Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker + Copyright (C) 2000-2003 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 @@ -248,7 +248,7 @@ 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; + set_jcr_job_status(jcr, JS_WaitSD); while (!jcr->msg_thread_done && !job_cancelled(jcr)) { struct timeval tv; struct timezone tz; @@ -261,5 +261,5 @@ void wait_for_storage_daemon_termination(JCR *jcr) pthread_cond_timedwait(&jcr->term_wait, &jcr->mutex, &timeout); } V(jcr->mutex); - jcr->JobStatus = jcr->SDJobStatus; + set_jcr_job_status(jcr, jcr->SDJobStatus); } diff --git a/bacula/src/dird/restore.c b/bacula/src/dird/restore.c index 9fae901c52..80ba26a383 100644 --- a/bacula/src/dird/restore.c +++ b/bacula/src/dird/restore.c @@ -21,7 +21,7 @@ */ /* - Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker + Copyright (C) 2000-2003 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 @@ -137,7 +137,7 @@ int do_restore(JCR *jcr) * */ Dmsg0(10, "Open connection with storage daemon\n"); - jcr->JobStatus = JS_Blocked; + set_jcr_job_status(jcr, JS_Blocked); /* * Start conversation with Storage daemon */ @@ -170,7 +170,7 @@ int do_restore(JCR *jcr) } fd = jcr->file_bsock; - jcr->JobStatus = JS_Running; + set_jcr_job_status(jcr, JS_Running); if (!send_include_list(jcr)) { restore_cleanup(jcr, JS_ErrorTerminated); @@ -188,7 +188,7 @@ int do_restore(JCR *jcr) * then wait for File daemon to make connection * with Storage daemon. */ - jcr->JobStatus = JS_Blocked; + set_jcr_job_status(jcr, JS_Blocked); if (jcr->store->SDDport == 0) { jcr->store->SDDport = jcr->store->SDport; } @@ -198,7 +198,7 @@ int do_restore(JCR *jcr) restore_cleanup(jcr, JS_ErrorTerminated); return 0; } - jcr->JobStatus = JS_Running; + set_jcr_job_status(jcr, JS_Running); /* * Send the bootstrap file -- what Volumes/files to restore @@ -257,13 +257,13 @@ int do_restore(JCR *jcr) Dmsg0(20, "wait for job termination\n"); while (bget_msg(fd, 0) >= 0) { Dmsg1(100, "dirdmsg); - if (sscanf(fd->msg, EndRestore, &jcr->JobStatus, &jcr->JobFiles, + if (sscanf(fd->msg, EndRestore, &jcr->FDJobStatus, &jcr->JobFiles, &jcr->JobBytes) == 3) { ok = TRUE; } } - restore_cleanup(jcr, ok?jcr->JobStatus:JS_ErrorTerminated); + restore_cleanup(jcr, ok?jcr->FDJobStatus:JS_ErrorTerminated); return 1; } @@ -282,7 +282,7 @@ static void restore_cleanup(JCR *jcr, int TermCode) double kbps; Dmsg0(20, "In restore_cleanup\n"); - jcr->JobStatus = TermCode; + set_jcr_job_status(jcr, TermCode); update_job_end_record(jcr); @@ -355,7 +355,7 @@ static int send_bootstrap_file(JCR *jcr) if (!bs) { Jmsg(jcr, M_FATAL, 0, _("Could not open bootstrap file %s: ERR=%s\n"), jcr->RestoreBootstrap, strerror(errno)); - jcr->JobStatus = JS_ErrorTerminated; + set_jcr_job_status(jcr, JS_ErrorTerminated); return 0; } strcpy(fd->msg, bootstrap); @@ -368,7 +368,7 @@ static int send_bootstrap_file(JCR *jcr) bnet_sig(fd, BNET_EOD); fclose(bs); if (!response(fd, OKbootstrap, "Bootstrap")) { - jcr->JobStatus = JS_ErrorTerminated; + set_jcr_job_status(jcr, JS_ErrorTerminated); return 0; } return 1; diff --git a/bacula/src/dird/sql_cmds.c b/bacula/src/dird/sql_cmds.c index c8999c36ef..f2e7b3abca 100644 --- a/bacula/src/dird/sql_cmds.c +++ b/bacula/src/dird/sql_cmds.c @@ -8,7 +8,7 @@ */ /* - Copyright (C) 2002 Kern Sibbald and John Walker + Copyright (C) 2002-2003 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 diff --git a/bacula/src/dird/ua_cmds.c b/bacula/src/dird/ua_cmds.c index b5c91b5b86..72f72aa309 100644 --- a/bacula/src/dird/ua_cmds.c +++ b/bacula/src/dird/ua_cmds.c @@ -8,7 +8,7 @@ */ /* - Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker + Copyright (C) 2000-2003 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 @@ -411,7 +411,7 @@ static int cancelcmd(UAContext *ua, char *cmd) switch (jcr->JobStatus) { case JS_Created: - jcr->JobStatus = JS_Cancelled; + set_jcr_job_status(jcr, JS_Cancelled); bsendmsg(ua, _("JobId %d, Job %s marked to be cancelled.\n"), jcr->JobId, jcr->Job); free_jcr(jcr); @@ -419,7 +419,7 @@ static int cancelcmd(UAContext *ua, char *cmd) default: - jcr->JobStatus = JS_Cancelled; + set_jcr_job_status(jcr, JS_Cancelled); /* Cancel File daemon */ ua->jcr->client = jcr->client; if (!connect_to_file_daemon(ua->jcr, 10, FDConnectTimeout, 1)) { diff --git a/bacula/src/dird/verify.c b/bacula/src/dird/verify.c index 626cd89edd..56793efa25 100644 --- a/bacula/src/dird/verify.c +++ b/bacula/src/dird/verify.c @@ -21,7 +21,7 @@ */ /* - Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker + Copyright (C) 2000-2003 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 @@ -153,7 +153,7 @@ int do_verify(JCR *jcr) /* * Start conversation with Storage daemon */ - jcr->JobStatus = JS_Blocked; + set_jcr_job_status(jcr, JS_Blocked); if (!connect_to_storage_daemon(jcr, 10, SDConnectTimeout, 1)) { goto bail_out; } @@ -177,12 +177,12 @@ int do_verify(JCR *jcr) * OK, now connect to the File daemon * and ask him for the files. */ - jcr->JobStatus = JS_Blocked; + set_jcr_job_status(jcr, JS_Blocked); if (!connect_to_file_daemon(jcr, 10, FDConnectTimeout, 1)) { goto bail_out; } - jcr->JobStatus = JS_Running; + set_jcr_job_status(jcr, JS_Running); fd = jcr->file_bsock; Dmsg0(30, ">filed: Send include list\n"); @@ -264,13 +264,13 @@ int do_verify(JCR *jcr) Dmsg0(10, "Verify level=volume\n"); get_attributes_and_compare_to_catalog(jcr, JobId); stat = jcr->JobStatus; - jcr->JobStatus = JS_WaitSD; + set_jcr_job_status(jcr, 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; + set_jcr_job_status(jcr, jcr->SDJobStatus); } else { - jcr->JobStatus = stat; + set_jcr_job_status(jcr, stat); } break; @@ -309,7 +309,7 @@ static void verify_cleanup(JCR *jcr, int TermCode) Dmsg0(100, "Enter verify_cleanup()\n"); JobId = jcr->jr.JobId; - jcr->JobStatus = TermCode; + set_jcr_job_status(jcr, TermCode); update_job_end_record(jcr); @@ -608,12 +608,12 @@ int get_attributes_and_compare_to_catalog(JCR *jcr, JobId_t JobId) stat = JS_Differences; } free_pool_memory(fname); - jcr->JobStatus = stat; + set_jcr_job_status(jcr, stat); return 1; bail_out: free_pool_memory(fname); - jcr->JobStatus = JS_ErrorTerminated; + set_jcr_job_status(jcr, JS_ErrorTerminated); return 0; } diff --git a/bacula/src/filed/backup.c b/bacula/src/filed/backup.c index ee06f268e5..b2aaf2649a 100644 --- a/bacula/src/filed/backup.c +++ b/bacula/src/filed/backup.c @@ -44,7 +44,7 @@ int blast_data_to_storage_daemon(JCR *jcr, char *addr) sd = jcr->store_bsock; - jcr->JobStatus = JS_Running; + set_jcr_job_status(jcr, JS_Running); Dmsg1(110, "bfiled: opened data connection %d to stored\n", sd->fd); @@ -63,11 +63,11 @@ int blast_data_to_storage_daemon(JCR *jcr, char *addr) jcr->compress_buf = get_memory(jcr->compress_buf_size); Dmsg1(100, "set_find_options ff=%p\n", jcr->ff); - set_find_options(jcr->ff, jcr->incremental, jcr->mtime); + set_find_options((FF_PKT *)jcr->ff, jcr->incremental, jcr->mtime); Dmsg0(110, "start find files\n"); /* Subroutine save_file() is called for each file */ - if (!find_files(jcr->ff, save_file, (void *)jcr)) { + if (!find_files(jcr, (FF_PKT *)jcr->ff, save_file, (void *)jcr)) { stat = 0; /* error */ } diff --git a/bacula/src/filed/estimate.c b/bacula/src/filed/estimate.c index ccd5d5763f..dbec154325 100644 --- a/bacula/src/filed/estimate.c +++ b/bacula/src/filed/estimate.c @@ -41,9 +41,9 @@ int make_estimate(JCR *jcr) jcr->JobStatus = JS_Running; - set_find_options(jcr->ff, jcr->incremental, jcr->mtime); + set_find_options((FF_PKT *)jcr->ff, jcr->incremental, jcr->mtime); - stat = find_files(jcr->ff, tally_file, (void *)jcr); + stat = find_files(jcr, (FF_PKT *)jcr->ff, tally_file, (void *)jcr); return stat; } diff --git a/bacula/src/filed/filed.h b/bacula/src/filed/filed.h index e16d10318d..749dfd8dad 100644 --- a/bacula/src/filed/filed.h +++ b/bacula/src/filed/filed.h @@ -25,8 +25,8 @@ */ -#include "findlib/find.h" #define FILE_DAEMON 1 +#include "findlib/find.h" #include "jcr.h" #include "protos.h" /* file daemon prototypes */ #include "filed_conf.h" diff --git a/bacula/src/filed/job.c b/bacula/src/filed/job.c index b0418bdcb0..f475e1c2dc 100644 --- a/bacula/src/filed/job.c +++ b/bacula/src/filed/job.c @@ -196,7 +196,7 @@ void *handle_client_request(void *dirp) } } Dmsg0(100, "Calling term_find_files\n"); - term_find_files(jcr->ff); + term_find_files((FF_PKT *)jcr->ff); Dmsg0(100, "Done with term_find_files\n"); free_jcr(jcr); /* destroy JCR record */ Dmsg0(100, "Done with free_jcr\n"); @@ -231,7 +231,7 @@ static int cancel_cmd(JCR *jcr) if (!(cjcr=get_jcr_by_full_name(Job))) { bnet_fsend(dir, "2901 Job %s not found.\n", Job); } else { - cjcr->JobStatus = JS_Cancelled; + set_jcr_job_status(cjcr, JS_Cancelled); free_jcr(cjcr); bnet_fsend(dir, "2001 Job %s marked to be cancelled.\n", Job); } @@ -305,7 +305,7 @@ static int include_cmd(JCR *jcr) dir->msg[dir->msglen] = 0; strip_trailing_junk(dir->msg); Dmsg1(010, "include file: %s\n", dir->msg); - add_fname_to_include_list(jcr->ff, 1, dir->msg); + add_fname_to_include_list((FF_PKT *)jcr->ff, 1, dir->msg); } return bnet_fsend(dir, OKinc); @@ -329,7 +329,7 @@ static int exclude_cmd(JCR *jcr) /* Skip spaces */ for ( ; *p && *p == ' '; p++) { } - add_fname_to_exclude_list(jcr->ff, p); + add_fname_to_exclude_list((FF_PKT *)jcr->ff, p); Dmsg1(110, "msg); } @@ -492,13 +492,13 @@ static int backup_cmd(JCR *jcr) int ok = 0; int SDJobStatus; - jcr->JobStatus = JS_Blocked; + set_jcr_job_status(jcr, JS_Blocked); jcr->JobType = JT_BACKUP; - Dmsg1(100, "begin backup ff=%p\n", jcr->ff); + Dmsg1(100, "begin backup ff=%p\n", (FF_PKT *)jcr->ff); if (sd == NULL) { Jmsg(jcr, M_FATAL, 0, _("Cannot contact Storage daemon\n")); - jcr->JobStatus = JS_ErrorTerminated; + set_jcr_job_status(jcr, JS_ErrorTerminated); goto cleanup; } @@ -517,13 +517,13 @@ static int backup_cmd(JCR *jcr) Dmsg1(110, "msg); if (sscanf(sd->msg, OK_open, &jcr->Ticket) != 1) { Jmsg(jcr, M_FATAL, 0, _("Bad response to append open: %s\n"), sd->msg); - jcr->JobStatus = JS_ErrorTerminated; + set_jcr_job_status(jcr, JS_ErrorTerminated); goto cleanup; } Dmsg1(110, "Got Ticket=%d\n", jcr->Ticket); } else { Jmsg(jcr, M_FATAL, 0, _("Bad response from stored to open command\n")); - jcr->JobStatus = JS_ErrorTerminated; + set_jcr_job_status(jcr, JS_ErrorTerminated); goto cleanup; } @@ -538,23 +538,23 @@ static int backup_cmd(JCR *jcr) */ Dmsg1(110, "msg); if (!response(jcr, sd, OK_data, "Append Data")) { - jcr->JobStatus = JS_ErrorTerminated; + set_jcr_job_status(jcr, JS_ErrorTerminated); goto cleanup; } /* * Send Files to Storage daemon */ - Dmsg1(110, "begin blast ff=%p\n", jcr->ff); + Dmsg1(110, "begin blast ff=%p\n", (FF_PKT *)jcr->ff); if (!blast_data_to_storage_daemon(jcr, NULL)) { - jcr->JobStatus = JS_ErrorTerminated; + set_jcr_job_status(jcr, JS_ErrorTerminated); } else { - jcr->JobStatus = JS_Terminated; + set_jcr_job_status(jcr, JS_Terminated); /* * Expect to get response to append_data from Storage daemon */ if (!response(jcr, sd, OK_append, "Append Data")) { - jcr->JobStatus = JS_ErrorTerminated; + set_jcr_job_status(jcr, JS_ErrorTerminated); goto cleanup; } @@ -564,7 +564,7 @@ static int backup_cmd(JCR *jcr) bnet_fsend(sd, append_end, jcr->Ticket); /* Get end OK */ if (!response(jcr, sd, OK_end, "Append End")) { - jcr->JobStatus = JS_ErrorTerminated; + set_jcr_job_status(jcr, JS_ErrorTerminated); goto cleanup; } @@ -580,13 +580,13 @@ static int backup_cmd(JCR *jcr) } if (!ok) { Jmsg(jcr, M_FATAL, 0, _("Append Close with SD failed.\n")); - jcr->JobStatus = JS_ErrorTerminated; + set_jcr_job_status(jcr, JS_ErrorTerminated); goto cleanup; } if (SDJobStatus != JS_Terminated) { Jmsg(jcr, M_FATAL, 0, _("Bad status %d returned from Storage Daemon.\n"), SDJobStatus); - jcr->JobStatus = JS_ErrorTerminated; + set_jcr_job_status(jcr, JS_ErrorTerminated); } } @@ -708,7 +708,7 @@ static int restore_cmd(JCR *jcr) Dmsg1(110, "bfiled>dird: %s", dir->msg); jcr->JobType = JT_RESTORE; - jcr->JobStatus = JS_Blocked; + set_jcr_job_status(jcr, JS_Blocked); if (!open_sd_read_session(jcr)) { return 0; @@ -860,7 +860,7 @@ static int send_bootstrap_file(JCR *jcr) if (!bs) { Jmsg(jcr, M_FATAL, 0, _("Could not open bootstrap file %s: ERR=%s\n"), jcr->RestoreBootstrap, strerror(errno)); - jcr->JobStatus = JS_ErrorTerminated; + set_jcr_job_status(jcr, JS_ErrorTerminated); return 0; } strcpy(sd->msg, bootstrap); @@ -873,7 +873,7 @@ static int send_bootstrap_file(JCR *jcr) bnet_sig(sd, BNET_EOD); fclose(bs); if (!response(jcr, sd, OKSDbootstrap, "Bootstrap")) { - jcr->JobStatus = JS_ErrorTerminated; + set_jcr_job_status(jcr, JS_ErrorTerminated); return 0; } return 1; diff --git a/bacula/src/filed/restore.c b/bacula/src/filed/restore.c index e6b83112fe..b4d2ec631a 100644 --- a/bacula/src/filed/restore.c +++ b/bacula/src/filed/restore.c @@ -65,7 +65,7 @@ void do_restore(JCR *jcr) wherelen = strlen(jcr->where); sd = jcr->store_bsock; - jcr->JobStatus = JS_Running; + set_jcr_job_status(jcr, JS_Running); if (!bnet_set_buffer_size(sd, MAX_NETWORK_BUFFER_SIZE, BNET_SETBUF_READ)) { return; @@ -376,11 +376,11 @@ void do_restore(JCR *jcr) set_attributes(jcr, fname, ofile, lname, type, stream, &statp, attribsEx, &ofd); } - jcr->JobStatus = JS_Terminated; + set_jcr_job_status(jcr, JS_Terminated); goto ok_out; bail_out: - jcr->JobStatus = JS_ErrorTerminated; + set_jcr_job_status(jcr, JS_ErrorTerminated); ok_out: if (jcr->compress_buf) { free(jcr->compress_buf); diff --git a/bacula/src/filed/verify.c b/bacula/src/filed/verify.c index 231dc7686e..f089e23062 100644 --- a/bacula/src/filed/verify.c +++ b/bacula/src/filed/verify.c @@ -44,10 +44,10 @@ void do_verify(JCR *jcr) if ((jcr->big_buf = (char *) malloc(jcr->buf_size)) == NULL) { Emsg1(M_ABORT, 0, _("Cannot malloc %d network read buffer\n"), MAX_NETWORK_BUFFER_SIZE); } - set_find_options(jcr->ff, jcr->incremental, jcr->mtime); + set_find_options((FF_PKT *)jcr->ff, jcr->incremental, jcr->mtime); Dmsg0(10, "Start find files\n"); /* Subroutine verify_file() is called for each file */ - find_files(jcr->ff, verify_file, (void *)jcr); + find_files(jcr, (FF_PKT *)jcr->ff, verify_file, (void *)jcr); Dmsg0(10, "End find files\n"); bnet_sig(dir, BNET_EOD); /* signal end of data */ diff --git a/bacula/src/filed/verify_vol.c b/bacula/src/filed/verify_vol.c index 61a15198a6..7386777da6 100644 --- a/bacula/src/filed/verify_vol.c +++ b/bacula/src/filed/verify_vol.c @@ -57,14 +57,14 @@ void do_verify_volume(JCR *jcr) sd = jcr->store_bsock; if (!sd) { Jmsg(jcr, M_FATAL, 0, _("Storage command not issued before Verify.\n")); - jcr->JobStatus = JS_FatalError; + set_jcr_job_status(jcr, JS_FatalError); return; } dir = jcr->dir_bsock; - jcr->JobStatus = JS_Running; + set_jcr_job_status(jcr, JS_Running); if (!bnet_set_buffer_size(sd, MAX_NETWORK_BUFFER_SIZE, BNET_SETBUF_READ)) { - jcr->JobStatus = JS_FatalError; + set_jcr_job_status(jcr, JS_FatalError); return; } jcr->buf_size = sd->msglen; diff --git a/bacula/src/findlib/find.c b/bacula/src/findlib/find.c index 0f3af61761..17de805ee7 100644 --- a/bacula/src/findlib/find.c +++ b/bacula/src/findlib/find.c @@ -28,10 +28,6 @@ #include "bacula.h" #include "find.h" -/* Imported functions */ -int find_one_file(FF_PKT *ff, int handle_file(FF_PKT *ff_pkt, void *hpkt), - void *pkt, char *p, dev_t parent_device, int top_level); -int term_find_one(FF_PKT *ff); size_t name_max; /* filename max length */ size_t path_max; /* path name max length */ @@ -106,17 +102,17 @@ set_find_options(FF_PKT *ff, int incremental, time_t save_time) * */ int -find_files(FF_PKT *ff, int callback(FF_PKT *ff_pkt, void *hpkt), void *his_pkt) +find_files(JCR *jcr, FF_PKT *ff, int callback(FF_PKT *ff_pkt, void *hpkt), void *his_pkt) { char *file; struct s_included_file *inc = NULL; - while ((inc = get_next_included_file(ff, inc))) { + while (!job_cancelled(jcr) && (inc = get_next_included_file(ff, inc))) { file = inc->fname; strcpy(ff->VerifyOpts, inc->VerifyOpts); /* Copy options for this file */ Dmsg1(50, "find_files: file=%s\n", file); if (!file_is_excluded(ff, file)) { - if (!find_one_file(ff, callback, his_pkt, file, (dev_t)-1, 1)) { + if (!find_one_file(jcr, ff, callback, his_pkt, file, (dev_t)-1, 1)) { return 0; /* error return */ } } diff --git a/bacula/src/findlib/find.h b/bacula/src/findlib/find.h index a696e5156f..31b8e55f78 100755 --- a/bacula/src/findlib/find.h +++ b/bacula/src/findlib/find.h @@ -26,6 +26,8 @@ #ifndef __FILES_H #define __FILES_H +#include "jcr.h" + #ifdef HAVE_DIRENT_H #include #define NAMELEN(dirent) (strlen((dirent)->d_name)) @@ -46,42 +48,42 @@ /* * Status codes returned by create_file() */ -#define CF_SKIP 1 /* skip file (not newer or something) */ -#define CF_ERROR 2 /* error creating file */ -#define CF_EXTRACT 3 /* file created, data to extract */ -#define CF_CREATED 4 /* file created, no data to extract */ +#define CF_SKIP 1 /* skip file (not newer or something) */ +#define CF_ERROR 2 /* error creating file */ +#define CF_EXTRACT 3 /* file created, data to extract */ +#define CF_CREATED 4 /* file created, no data to extract */ /* * NOTE!!! These go on the tape, so don't change them. If * need be, add to them. */ -#define FT_LNKSAVED 1 /* hard link to file already saved */ -#define FT_REGE 2 /* Regular file but empty */ -#define FT_REG 3 /* Regular file */ -#define FT_LNK 4 /* Soft Link */ -#define FT_DIR 5 /* Directory */ -#define FT_SPEC 6 /* Special file -- chr, blk, fifo, sock */ -#define FT_NOACCESS 7 /* Not able to access */ -#define FT_NOFOLLOW 8 /* Could not follow link */ -#define FT_NOSTAT 9 /* Could not stat file */ -#define FT_NOCHG 10 /* Incremental option, file not changed */ -#define FT_DIRNOCHG 11 /* Incremental option, directory not changed */ -#define FT_ISARCH 12 /* Trying to save archive file */ -#define FT_NORECURSE 13 /* No recursion into directory */ -#define FT_NOFSCHG 14 /* Different file system, prohibited */ -#define FT_NOOPEN 15 /* Could not open directory */ -#define FT_RAW 16 /* Raw block device */ -#define FT_FIFO 17 /* Raw fifo device */ +#define FT_LNKSAVED 1 /* hard link to file already saved */ +#define FT_REGE 2 /* Regular file but empty */ +#define FT_REG 3 /* Regular file */ +#define FT_LNK 4 /* Soft Link */ +#define FT_DIR 5 /* Directory */ +#define FT_SPEC 6 /* Special file -- chr, blk, fifo, sock */ +#define FT_NOACCESS 7 /* Not able to access */ +#define FT_NOFOLLOW 8 /* Could not follow link */ +#define FT_NOSTAT 9 /* Could not stat file */ +#define FT_NOCHG 10 /* Incremental option, file not changed */ +#define FT_DIRNOCHG 11 /* Incremental option, directory not changed */ +#define FT_ISARCH 12 /* Trying to save archive file */ +#define FT_NORECURSE 13 /* No recursion into directory */ +#define FT_NOFSCHG 14 /* Different file system, prohibited */ +#define FT_NOOPEN 15 /* Could not open directory */ +#define FT_RAW 16 /* Raw block device */ +#define FT_FIFO 17 /* Raw fifo device */ /* Options saved in "flag" of ff packet */ -#define FO_MD5 0x01 /* Do MD5 checksum */ -#define FO_GZIP 0x02 /* Do Zlib compression */ -#define FO_NO_RECURSION 0x04 /* no recursion in directories */ -#define FO_MULTIFS 0x08 /* multiple file systems */ -#define FO_SPARSE 0x10 /* do sparse file checking */ -#define FO_IF_NEWER 0x20 /* replace if newer */ -#define FO_NOREPLACE 0x40 /* never replace */ -#define FO_READFIFO 0x80 /* read data from fifo */ +#define FO_MD5 0x01 /* Do MD5 checksum */ +#define FO_GZIP 0x02 /* Do Zlib compression */ +#define FO_NO_RECURSION 0x04 /* no recursion in directories */ +#define FO_MULTIFS 0x08 /* multiple file systems */ +#define FO_SPARSE 0x10 /* do sparse file checking */ +#define FO_IF_NEWER 0x20 /* replace if newer */ +#define FO_NOREPLACE 0x40 /* never replace */ +#define FO_READFIFO 0x80 /* read data from fifo */ /* * Options saved in "options" of include list @@ -93,21 +95,21 @@ #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 */ -#define OPT_sparse 0x10 /* do sparse file checking */ +#define OPT_multifs 0x08 /* multiple file systems */ +#define OPT_sparse 0x10 /* do sparse file checking */ #define OPT_replace_if_newer 0x20 /* replace file if newer */ #define OPT_never_replace 0x40 /* never replace */ -#define OPT_read_fifo 0x80 /* read data from fifo (named pipe) */ +#define OPT_read_fifo 0x80 /* read data from fifo (named pipe) */ struct s_included_file { struct s_included_file *next; - int options; /* backup options */ - int level; /* compression level */ - int len; /* length of fname */ - int pattern; /* set if pattern */ - char VerifyOpts[20]; /* Options for verify */ + int options; /* backup options */ + int level; /* compression level */ + int len; /* length of fname */ + int pattern; /* set if pattern */ + char VerifyOpts[20]; /* Options for verify */ char fname[1]; }; @@ -123,27 +125,27 @@ struct s_excluded_file { * first argument to the find_files callback subroutine. */ typedef struct ff { - char *fname; /* filename */ - char *link; /* link if file linked */ - POOLMEM *sys_fname; /* system filename */ - struct stat statp; /* stat packet */ - int type; /* FT_ type from above */ - int fid; /* file id if opened */ - int flags; /* control flags */ - int ff_errno; /* errno */ - int incremental; /* do incremental save */ - time_t save_time; /* start of incremental time */ - int mtime_only; /* incremental on mtime_only */ - int dereference; /* follow links */ - int GZIP_level; /* compression level */ - int atime_preserve; /* preserve access times */ - int null_output_device; /* using null output device */ + char *fname; /* filename */ + char *link; /* link if file linked */ + POOLMEM *sys_fname; /* system filename */ + struct stat statp; /* stat packet */ + int type; /* FT_ type from above */ + int fid; /* file id if opened */ + int flags; /* control flags */ + int ff_errno; /* errno */ + int incremental; /* do incremental save */ + time_t save_time; /* start of incremental time */ + int mtime_only; /* incremental on mtime_only */ + int dereference; /* follow links */ + int GZIP_level; /* compression level */ + int atime_preserve; /* preserve access times */ + int null_output_device; /* using null output device */ char VerifyOpts[20]; struct s_included_file *included_files_list; struct s_excluded_file *excluded_files_list; struct s_excluded_file *excluded_paths_list; - struct f_link *linklist; /* hard linked files */ + struct f_link *linklist; /* hard linked files */ } FF_PKT; #include "protos.h" diff --git a/bacula/src/findlib/find_one.c b/bacula/src/findlib/find_one.c index 132de5a40b..d80036fb23 100755 --- a/bacula/src/findlib/find_one.c +++ b/bacula/src/findlib/find_one.c @@ -17,17 +17,16 @@ 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. + ideas, it has been rewritten for Bacula. Kern Sibbald, MM - Many thanks to the TAR programmers. + Thanks to the TAR programmers. */ #include "bacula.h" #include "find.h" -/*#include "system.h" */ extern size_t name_max; /* filename max length */ @@ -53,11 +52,10 @@ struct f_link { #if HAVE_UTIME_H # include #else -struct utimbuf - { +struct utimbuf { long actime; long modtime; - }; +}; #endif @@ -70,8 +68,8 @@ struct utimbuf * decending into a directory. */ int -find_one_file(FF_PKT *ff_pkt, int handle_file(FF_PKT *ff, void *hpkt), void *pkt, - char *fname, dev_t parent_device, int top_level) +find_one_file(JCR *jcr, FF_PKT *ff_pkt, int handle_file(FF_PKT *ff, void *hpkt), + void *pkt, char *fname, dev_t parent_device, int top_level) { struct utimbuf restore_times; int rtn_stat; @@ -271,7 +269,7 @@ find_one_file(FF_PKT *ff_pkt, int handle_file(FF_PKT *ff, void *hpkt), void *pkt */ rtn_stat = 1; entry = (struct dirent *)malloc(sizeof(struct dirent) + name_max + 100); - for ( ;; ) { + for ( ; !job_cancelled(jcr); ) { char *p, *q; int i; @@ -301,7 +299,7 @@ find_one_file(FF_PKT *ff_pkt, int handle_file(FF_PKT *ff, void *hpkt), void *pkt *q = 0; sm_check(__FILE__, __LINE__, False); if (!file_is_excluded(ff_pkt, link)) { - rtn_stat = find_one_file(ff_pkt, handle_file, pkt, link, our_device, 0); + rtn_stat = find_one_file(jcr, ff_pkt, handle_file, pkt, link, our_device, 0); } } closedir(directory); diff --git a/bacula/src/findlib/protos.h b/bacula/src/findlib/protos.h index e58e9af2ff..3c2c876362 100644 --- a/bacula/src/findlib/protos.h +++ b/bacula/src/findlib/protos.h @@ -24,22 +24,22 @@ */ /* from attribs.c */ -void encode_stat (char *buf, struct stat *statp); -void decode_stat (char *buf, struct stat *statp); -int encode_attribsEx (void *jcr, char *attribsEx, FF_PKT *ff_pkt); +void encode_stat (char *buf, struct stat *statp); +void decode_stat (char *buf, struct stat *statp); +int encode_attribsEx (void *jcr, char *attribsEx, FF_PKT *ff_pkt); int set_attributes(void *jcr, char *fname, char *ofile, char *lname, - int type, int stream, struct stat *statp, - char *attribsEx, int *ofd); + int type, int stream, struct stat *statp, + char *attribsEx, int *ofd); /* from create_file.c */ int create_file(void *jcr, char *fname, char *ofile, char *lname, - int type, int stream, struct stat *statp, - char *attribsEx, int *ofd, int replace); + int type, int stream, struct stat *statp, + char *attribsEx, int *ofd, int replace); /* From find.c */ FF_PKT *init_find_files(); void set_find_options(FF_PKT *ff, int incremental, time_t mtime); -int find_files(FF_PKT *ff, int sub(FF_PKT *ff_pkt, void *hpkt), void *pkt); +int find_files(JCR *jcr, FF_PKT *ff, int sub(FF_PKT *ff_pkt, void *hpkt), void *pkt); int term_find_files(FF_PKT *ff); /* From match.c */ @@ -50,10 +50,15 @@ void add_fname_to_exclude_list(FF_PKT *ff, char *fname); int file_is_excluded(FF_PKT *ff, char *file); int file_is_included(FF_PKT *ff, char *file); struct s_included_file *get_next_included_file(FF_PKT *ff, - struct s_included_file *inc); + struct s_included_file *inc); + +/* From find_one.c */ +int find_one_file(JCR *jcr, FF_PKT *ff, int handle_file(FF_PKT *ff_pkt, void *hpkt), + void *pkt, char *p, dev_t parent_device, int top_level); +int term_find_one(FF_PKT *ff); /* from makepath.c */ int make_path(void *jcr, const char *argpath, int mode, - int parent_mode, uid_t owner, gid_t group, - int preserve_existing, char *verbose_fmt_string); + int parent_mode, uid_t owner, gid_t group, + int preserve_existing, char *verbose_fmt_string); diff --git a/bacula/src/jcr.h b/bacula/src/jcr.h index 2fa0eebe45..6fea571fc9 100644 --- a/bacula/src/jcr.h +++ b/bacula/src/jcr.h @@ -127,6 +127,7 @@ struct s_jcr { CAT *catalog; /* Catalog resource */ MSGS *messages; /* Default message handler */ int SDJobStatus; /* Storage Job Status */ + int FDJobStatus; /* File daemon Job Status */ int mode; /* manual/auto run */ B_DB *db; /* database pointer */ uint32_t MediaId; /* DB record IDs associated with this job */ @@ -160,7 +161,7 @@ struct s_jcr { POOLMEM *where; /* Root where to restore */ int replace; /* Replace options */ int buf_size; /* length of buffer */ - FF_PKT *ff; /* Find Files packet */ + void *ff; /* Find Files packet */ char stored_addr[MAX_NAME_LENGTH]; /* storage daemon address */ uint32_t StartFile; uint32_t EndFile; @@ -249,6 +250,7 @@ extern JCR *get_jcr_by_full_name(char *Job); extern JCR *get_next_jcr(JCR *jcr); extern void lock_jcr_chain(); extern void unlock_jcr_chain(); +extern void set_jcr_job_status(JCR *jcr, int JobStatus); #ifdef DEBUG extern void b_free_jcr(char *file, int line, JCR *jcr); diff --git a/bacula/src/lib/jcr.c b/bacula/src/lib/jcr.c index 1ee2787d22..918882d05c 100755 --- a/bacula/src/lib/jcr.c +++ b/bacula/src/lib/jcr.c @@ -177,7 +177,9 @@ void free_jcr(JCR *jcr) remove_jcr(jcr); V(mutex); - jcr->daemon_free_jcr(jcr); /* call daemon free routine */ + if (jcr->daemon_free_jcr) { + jcr->daemon_free_jcr(jcr); /* call daemon free routine */ + } free_common_jcr(jcr); Dmsg0(200, "Exit free_jcr\n"); } @@ -294,6 +296,24 @@ JCR *get_jcr_by_full_name(char *Job) return jcr; } +void set_jcr_job_status(JCR *jcr, int JobStatus) +{ + /* + * For a set of errors, ... keep the current status + * so it isn't lost. For all others, set it. + */ + switch (jcr->JobStatus) { + case JS_ErrorTerminated: + case JS_Error: + case JS_FatalError: + case JS_Differences: + case JS_Cancelled: + break; + default: + jcr->JobStatus = JobStatus; + } +} + /* * Lock the chain */ diff --git a/bacula/src/lib/md5.c b/bacula/src/lib/md5.c index 9b4b7b805a..ec48a43ee4 100644 --- a/bacula/src/lib/md5.c +++ b/bacula/src/lib/md5.c @@ -23,15 +23,7 @@ #include "bacula.h" -#ifdef sgi -#define HIGHFIRST -#endif - -#ifdef sun -#define HIGHFIRST -#endif - -#ifndef HIGHFIRST +#ifndef HAVE_BIGENDIAN #define byteReverse(buf, len) /* Nothing */ #else /* diff --git a/bacula/src/stored/append.c b/bacula/src/stored/append.c index aa2220ffee..f494cd63a7 100644 --- a/bacula/src/stored/append.c +++ b/bacula/src/stored/append.c @@ -60,7 +60,7 @@ int do_append_data(JCR *jcr) ds = fd_sock; if (!bnet_set_buffer_size(ds, MAX_NETWORK_BUFFER_SIZE, BNET_SETBUF_WRITE)) { - jcr->JobStatus = JS_Cancelled; + set_jcr_job_status(jcr, JS_ErrorTerminated); Jmsg(jcr, M_FATAL, 0, _("Unable to set network buffer size.\n")); return 0; } @@ -76,7 +76,7 @@ int do_append_data(JCR *jcr) */ Dmsg0(100, "just before acquire_device\n"); if (!acquire_device_for_append(jcr, dev, block)) { - jcr->JobStatus = JS_Cancelled; + set_jcr_job_status(jcr, JS_ErrorTerminated); free_block(block); return 0; } @@ -87,9 +87,9 @@ int do_append_data(JCR *jcr) * Write Begin Session Record */ if (!write_session_label(jcr, block, SOS_LABEL)) { - jcr->JobStatus = JS_Cancelled; Jmsg1(jcr, M_FATAL, 0, _("Write session label failed. ERR=%s\n"), strerror_dev(dev)); + set_jcr_job_status(jcr, JS_ErrorTerminated); ok = FALSE; } @@ -233,9 +233,9 @@ int do_append_data(JCR *jcr) Dmsg0(90, "Write_end_session_label()\n"); /* Create Job status for end of session label */ if (!job_cancelled(jcr) && ok) { - jcr->JobStatus = JS_Terminated; + set_jcr_job_status(jcr, JS_Terminated); } else if (!ok) { - jcr->JobStatus = JS_ErrorTerminated; + set_jcr_job_status(jcr, JS_ErrorTerminated); } if (!write_session_label(jcr, block, EOS_LABEL)) { Jmsg1(jcr, M_FATAL, 0, _("Error writting end session label. ERR=%s\n"), diff --git a/bacula/src/stored/askdir.c b/bacula/src/stored/askdir.c index d49ca21df2..1f9dfe812f 100644 --- a/bacula/src/stored/askdir.c +++ b/bacula/src/stored/askdir.c @@ -375,7 +375,7 @@ volumes for Job=%s.\n"), jcr->Job); } break; } - jcr->JobStatus = JS_Running; + set_jcr_job_status(jcr, JS_Running); dir_send_job_status(jcr); Dmsg0(130, "leave dir_ask_sysop_to_mount_next_volume\n"); return 1; @@ -489,7 +489,7 @@ int dir_ask_sysop_to_mount_volume(JCR *jcr, DEVICE *dev) num_wait = 0; break; } - jcr->JobStatus = JS_Running; + set_jcr_job_status(jcr, JS_Running); dir_send_job_status(jcr); Dmsg0(130, "leave dir_ask_sysop_to_mount_next_volume\n"); return 1; diff --git a/bacula/src/stored/bsr.h b/bacula/src/stored/bsr.h index 39acdd5624..7eb09721e3 100644 --- a/bacula/src/stored/bsr.h +++ b/bacula/src/stored/bsr.h @@ -30,8 +30,6 @@ #ifndef __BSR_H #define __BSR_H 1 -#include "findlib/find.h" - /* * List of Volume names to be read by Storage daemon. * Formed by Storage daemon from BSR @@ -47,10 +45,10 @@ 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. !!! + * !!! !!! * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */ @@ -68,35 +66,35 @@ typedef struct s_bsr_sessid { struct s_bsr_sessid *next; uint32_t sessid; uint32_t sessid2; - int done; /* local done */ + int done; /* local done */ } BSR_SESSID; typedef struct s_bsr_sesstime { struct s_bsr_sesstime *next; uint32_t sesstime; - int done; /* local done */ + int done; /* local done */ } BSR_SESSTIME; typedef struct s_bsr_volfile { struct s_bsr_volfile *next; - uint32_t sfile; /* start file */ - uint32_t efile; /* end file */ - int done; /* local done */ + uint32_t sfile; /* start file */ + uint32_t efile; /* end file */ + int done; /* local done */ } BSR_VOLFILE; typedef struct s_bsr_volblock { struct s_bsr_volblock *next; - uint32_t sblock; /* start block */ - uint32_t eblock; /* end block */ - int done; /* local done */ + uint32_t sblock; /* start block */ + uint32_t eblock; /* end block */ + int done; /* local done */ } BSR_VOLBLOCK; typedef struct s_bsr_findex { struct s_bsr_findex *next; - int32_t findex; /* start file index */ - int32_t findex2; /* end file index */ - int done; /* local done */ + int32_t findex; /* start file index */ + int32_t findex2; /* end file index */ + int done; /* local done */ } BSR_FINDEX; typedef struct s_bsr_jobid { @@ -123,28 +121,27 @@ typedef struct s_bsr_job { typedef struct s_bsr_stream { struct s_bsr_stream *next; - int32_t stream; /* stream desired */ + int32_t stream; /* stream desired */ } BSR_STREAM; typedef struct s_bsr { - struct s_bsr *next; /* pointer to next one */ - int done; /* set when everything found */ - BSR_VOLUME *volume; - int32_t Slot; /* Slot */ - uint32_t count; /* count of files to restore this bsr */ - uint32_t found; /* count of restored files this bsr */ - BSR_VOLFILE *volfile; + struct s_bsr *next; /* pointer to next one */ + int done; /* set when everything found */ + BSR_VOLUME *volume; + int32_t Slot; /* Slot */ + uint32_t count; /* count of files to restore this bsr */ + uint32_t found; /* count of restored files this bsr */ + BSR_VOLFILE *volfile; BSR_VOLBLOCK *volblock; 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; - BSR_STREAM *stream; -// FF_PKT *ff; /* include/exclude */ + BSR_STREAM *stream; } BSR; diff --git a/bacula/src/stored/btape.c b/bacula/src/stored/btape.c index 4d5c6cf108..f5ba06b07a 100644 --- a/bacula/src/stored/btape.c +++ b/bacula/src/stored/btape.c @@ -1044,7 +1044,7 @@ This may take a long time. I.e. hours! ...\n\n"); */ Dmsg0(100, "just before acquire_device\n"); if (!acquire_device_for_append(jcr, dev, block)) { - jcr->JobStatus = JS_Cancelled; + set_jcr_job_status(jcr, JS_ErrorTerminated); free_block(block); return; } @@ -1054,7 +1054,7 @@ This may take a long time. I.e. hours! ...\n\n"); * Write Begin Session Record */ if (!write_session_label(jcr, block, SOS_LABEL)) { - jcr->JobStatus = JS_Cancelled; + set_jcr_job_status(jcr, JS_ErrorTerminated); Jmsg1(jcr, M_FATAL, 0, _("Write session label failed. ERR=%s\n"), strerror_dev(dev)); ok = FALSE; @@ -1146,9 +1146,9 @@ This may take a long time. I.e. hours! ...\n\n"); Dmsg0(000, "Write_end_session_label()\n"); /* Create Job status for end of session label */ if (!job_cancelled(jcr) && ok) { - jcr->JobStatus = JS_Terminated; + set_jcr_job_status(jcr, JS_Terminated); } else if (!ok) { - jcr->JobStatus = JS_ErrorTerminated; + set_jcr_job_status(jcr, JS_ErrorTerminated); } if (!write_session_label(jcr, block, EOS_LABEL)) { Pmsg1(000, _("Error writting end session label. ERR=%s\n"), strerror_dev(dev)); diff --git a/bacula/src/stored/dircmd.c b/bacula/src/stored/dircmd.c index 210f30b8b9..598b864467 100644 --- a/bacula/src/stored/dircmd.c +++ b/bacula/src/stored/dircmd.c @@ -208,8 +208,8 @@ static int cancel_cmd(JCR *cjcr) } else { P(jcr->mutex); oldStatus = jcr->JobStatus; - jcr->JobStatus = JS_Cancelled; - if (!jcr->authenticated && jcr->JobStatus == JS_WaitFD) { + set_jcr_job_status(jcr, JS_Cancelled); + if (!jcr->authenticated && oldStatus == JS_WaitFD) { pthread_cond_signal(&jcr->job_start_wait); /* wake waiting thread */ } V(jcr->mutex); diff --git a/bacula/src/stored/job.c b/bacula/src/stored/job.c index e7ebbf56f9..46edf4ecc5 100644 --- a/bacula/src/stored/job.c +++ b/bacula/src/stored/job.c @@ -91,7 +91,7 @@ int job_cmd(JCR *jcr) free_memory(client_name); free_memory(fileset_name); free_memory(fileset_md5); - jcr->JobStatus = JS_ErrorTerminated; + set_jcr_job_status(jcr, JS_ErrorTerminated); return 0; } jcr->JobId = JobId; @@ -122,7 +122,7 @@ int job_cmd(JCR *jcr) /* Initialize FD start condition variable */ if ((errstat = pthread_cond_init(&jcr->job_start_wait, NULL)) != 0) { Jmsg1(jcr, M_FATAL, 0, _("Unable to init job cond variable: ERR=%s\n"), strerror(errstat)); - jcr->JobStatus = JS_ErrorTerminated; + set_jcr_job_status(jcr, JS_ErrorTerminated); return 0; } jcr->authenticated = FALSE; @@ -144,11 +144,11 @@ int job_cmd(JCR *jcr) * Wait for the device, media, and pool information */ if (!use_device_cmd(jcr)) { - jcr->JobStatus = JS_ErrorTerminated; + set_jcr_job_status(jcr, JS_ErrorTerminated); return 0; } - jcr->JobStatus = JS_WaitFD; /* wait for FD to connect */ + set_jcr_job_status(jcr, JS_WaitFD); /* wait for FD to connect */ dir_send_job_status(jcr); gettimeofday(&tv, &tz); diff --git a/bacula/src/stored/label.c b/bacula/src/stored/label.c index ddaf67d307..06863b33a5 100644 --- a/bacula/src/stored/label.c +++ b/bacula/src/stored/label.c @@ -75,7 +75,7 @@ int read_dev_volume_label(JCR *jcr, DEVICE *dev, DEV_BLOCK *block) * => we are in a loop */ if (jcr->label_errors > 100) { - jcr->JobStatus = JS_Cancelled; + set_jcr_job_status(jcr, JS_ErrorTerminated); Jmsg(jcr, M_FATAL, 0, "%s", jcr->errmsg); } return jcr->label_status = VOL_NAME_ERROR; @@ -139,7 +139,7 @@ because:\n %s"), dev_name(dev), strerror_dev(dev)); * => we are in a loop */ if (jcr->label_errors > 100) { - jcr->JobStatus = JS_Cancelled; + set_jcr_job_status(jcr, JS_ErrorTerminated); Jmsg(jcr, M_FATAL, 0, "%s", jcr->errmsg); } return jcr->label_status = VOL_NAME_ERROR; diff --git a/bacula/src/stored/stored.h b/bacula/src/stored/stored.h index 28a1dcf859..2a0ac6aa49 100644 --- a/bacula/src/stored/stored.h +++ b/bacula/src/stored/stored.h @@ -26,6 +26,8 @@ #ifndef __STORED_H_ #define __STORED_H_ +#define STORAGE_DAEMON 1 + #include #include "block.h" #include "record.h" @@ -40,6 +42,8 @@ #define uLongf uint32_t #endif +#include "findlib/find.h" + extern char errmsg[]; /* general error message */ #endif /* __STORED_H_ */ diff --git a/bacula/src/stored/stored_conf.h b/bacula/src/stored/stored_conf.h index 2c333b7656..80c0f98a58 100644 --- a/bacula/src/stored/stored_conf.h +++ b/bacula/src/stored/stored_conf.h @@ -4,7 +4,7 @@ * Version $Id$ */ /* - Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker + Copyright (C) 2000-2003 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 @@ -23,43 +23,41 @@ */ -#define R_FIRST 3001 +#define R_FIRST 3001 -#define R_DIRECTOR 3001 -#define R_STORAGE 3002 -#define R_DEVICE 3003 -#define R_MSGS 3004 +#define R_DIRECTOR 3001 +#define R_STORAGE 3002 +#define R_DEVICE 3003 +#define R_MSGS 3004 -#define R_LAST R_MSGS +#define R_LAST R_MSGS -#define R_NAME 3020 -#define R_ADDRESS 3021 -#define R_PASSWORD 3022 -#define R_TYPE 3023 -#define R_BACKUP 3024 - -#define STORAGE_DAEMON 1 +#define R_NAME 3020 +#define R_ADDRESS 3021 +#define R_PASSWORD 3022 +#define R_TYPE 3023 +#define R_BACKUP 3024 /* Definition of the contents of each Resource */ struct s_res_dir { - RES hdr; + RES hdr; - char *password; /* Director password */ - char *address; /* Director IP address or zero */ + char *password; /* Director password */ + char *address; /* Director IP address or zero */ }; typedef struct s_res_dir DIRRES; /* Storage daemon "global" definitions */ struct s_res_store { - RES hdr; + RES hdr; - char *address; /* deprecated */ - char *SDaddr; /* bind address */ - int SDport; /* Where we listen for Directors */ + char *address; /* deprecated */ + char *SDaddr; /* bind address */ + int SDport; /* Where we listen for Directors */ int SDDport; /* "Data" port where we listen for File daemons */ - char *working_directory; /* working directory for checkpoints */ + char *working_directory; /* working directory for checkpoints */ char *pid_directory; char *subsys_directory; uint32_t max_concurrent_jobs; /* maximum concurrent jobs to run */ @@ -69,32 +67,32 @@ typedef struct s_res_store STORES; /* Device specific definitions */ struct s_res_dev { - RES hdr; - - char *media_type; /* User assigned media type */ - char *device_name; /* Archive device name */ - char *changer_name; /* Changer device name */ - char *changer_command; /* Changer command -- external program */ - int cap_bits; /* Capabilities of this device */ - uint32_t max_changer_wait; /* Changer timeout */ - uint32_t max_rewind_wait; /* maximum secs to wait for rewind */ - uint32_t max_open_wait; /* maximum secs to wait for open */ - uint32_t min_block_size; /* min block size */ - uint32_t max_block_size; /* max block size */ - uint32_t max_volume_jobs; /* max jobs to put on one volume */ - int64_t max_volume_files; /* max files to put on one volume */ - int64_t max_volume_size; /* max bytes to put on one volume */ - int64_t max_file_size; /* max file size in bytes */ - int64_t volume_capacity; /* advisory capacity */ - DEVICE *dev; /* Pointer to phyical dev -- set at runtime */ + RES hdr; + + char *media_type; /* User assigned media type */ + char *device_name; /* Archive device name */ + char *changer_name; /* Changer device name */ + char *changer_command; /* Changer command -- external program */ + int cap_bits; /* Capabilities of this device */ + uint32_t max_changer_wait; /* Changer timeout */ + uint32_t max_rewind_wait; /* maximum secs to wait for rewind */ + uint32_t max_open_wait; /* maximum secs to wait for open */ + uint32_t min_block_size; /* min block size */ + uint32_t max_block_size; /* max block size */ + uint32_t max_volume_jobs; /* max jobs to put on one volume */ + int64_t max_volume_files; /* max files to put on one volume */ + int64_t max_volume_size; /* max bytes to put on one volume */ + int64_t max_file_size; /* max file size in bytes */ + int64_t volume_capacity; /* advisory capacity */ + DEVICE *dev; /* Pointer to phyical dev -- set at runtime */ }; typedef struct s_res_dev DEVRES; union u_res { - struct s_res_dir res_dir; - struct s_res_store res_store; - struct s_res_dev res_dev; - struct s_res_msgs res_msgs; + struct s_res_dir res_dir; + struct s_res_store res_store; + struct s_res_dev res_dev; + struct s_res_msgs res_msgs; RES hdr; }; typedef union u_res URES; diff --git a/bacula/src/tools/testfind.c b/bacula/src/tools/testfind.c index 5680a6cc06..5549a3059e 100644 --- a/bacula/src/tools/testfind.c +++ b/bacula/src/tools/testfind.c @@ -24,7 +24,6 @@ #include "bacula.h" #include "findlib/find.h" -#include "jcr.h" /* Global variables */ @@ -35,6 +34,7 @@ static int trunc_fname = 0; static int trunc_path = 0; static int attrs = 0; +static JCR *jcr; static int print_file(FF_PKT *ff, void *pkt); static void count_files(FF_PKT *ff); @@ -90,23 +90,25 @@ main (int argc, char *const *argv) argc -= optind; argv += optind; - ff = init_find_files(); + jcr = new_jcr(sizeof(JCR), NULL); + + ff = init_find_files(); if (argc == 0) { - add_fname_to_include_list(ff, 0, "/"); /* default to / */ - } else { + add_fname_to_include_list(ff, 0, "/"); /* default to / */ + } else { for (i=0; i < argc; i++) { - if (strcmp(argv[i], "-") == 0) { - while (fgets(name, sizeof(name)-1, stdin)) { - strip_trailing_junk(name); - add_fname_to_include_list(ff, 0, name); - } - continue; - } - add_fname_to_include_list(ff, 0, argv[i]); - } - } + if (strcmp(argv[i], "-") == 0) { + while (fgets(name, sizeof(name)-1, stdin)) { + strip_trailing_junk(name); + add_fname_to_include_list(ff, 0, name); + } + continue; + } + add_fname_to_include_list(ff, 0, argv[i]); + } + } - find_files(ff, print_file, NULL); + find_files(jcr, ff, print_file, NULL); hard_links = term_find_files(ff); printf(_("\ @@ -119,6 +121,7 @@ Hard links : %d\n"), num_files, max_file_len, max_path_len, trunc_fname, trunc_path, hard_links); + free_jcr(jcr); close_memory_pool(); sm_dump(False); exit(0);