From: Kern Sibbald Date: Thu, 15 May 2003 10:44:48 +0000 (+0000) Subject: BSDI port changes X-Git-Tag: Release-1.31~143 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=efade4b39d850596d19988fbe51f42d56f527866;p=bacula%2Fbacula BSDI port changes git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@513 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/autoconf/config.h.in b/bacula/autoconf/config.h.in index 6514b07aa8..70ba4bb5d0 100644 --- a/bacula/autoconf/config.h.in +++ b/bacula/autoconf/config.h.in @@ -390,6 +390,9 @@ /* Define if you have the strncpy function. */ #undef HAVE_STRNCPY +/* Define if you have the strtoll function. */ +#undef HAVE_STRTOLL + /* Define if you have the tcgetattr function. */ #undef HAVE_TCGETATTR diff --git a/bacula/autoconf/configure.in b/bacula/autoconf/configure.in index b0dacc2e42..424edf80df 100644 --- a/bacula/autoconf/configure.in +++ b/bacula/autoconf/configure.in @@ -1051,6 +1051,7 @@ AC_CHECK_FUNCS( \ strncmp \ strncpy \ vfprintf \ + strtoll \ ,, [echo 'configure: cannot find needed function.'; exit 1] ) @@ -1178,13 +1179,19 @@ alpha) ;; bsdi) DISTVER=`uname -a |awk '{print $3}'` - TAPEDRIVE="/dev/nrst0" - ;; -caldera) - DISTVER=`cat /etc/.issue | grep Version | cut -f 2 -d ' '` - TAPEDRIVE="/dev/nrst0" - PSCMD="ps -e -o pid,command" + TAPEDRIVE="/dev/nrmt0" + PTHREAD_LIB="-pthread" + CFLAGS="${CFLAGS} -pthread" + PSCMD="ps -x -o pid,command" + lld="qd" + llu="qu" + PFILES="${PFILES} \ + platforms/bsdi/Makefile \ + platforms/bsdi/bacula-fd \ + platforms/bsdi/bacula-sd \ + platforms/bsdi/bacula-dir" hostname=`hostname -s` + largefile_support="yes" ;; cygwin) DISTVER=`uname -a |awk '{print $3}'` @@ -1213,7 +1220,7 @@ freebsd) CFLAGS="${CFLAGS} -pthread" lld="qd" llu="qu" - TAPEDRIVE="/dev/nrst0" + TAPEDRIVE="/dev/nrsa0" PSCMD="ps -x -o pid,command" PFILES="${PFILES} \ platforms/freebsd/Makefile \ diff --git a/bacula/configure b/bacula/configure index f07781aa47..bc36f750e1 100755 --- a/bacula/configure +++ b/bacula/configure @@ -7588,15 +7588,16 @@ for ac_func in \ strncmp \ strncpy \ vfprintf \ + strtoll \ do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7595: checking for $ac_func" >&5 +echo "configure:7596: 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:7624: \"$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 @@ -7649,12 +7650,12 @@ done for ac_func in fchdir do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7653: checking for $ac_func" >&5 +echo "configure:7654: 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:7682: \"$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 @@ -7708,12 +7709,12 @@ done for ac_func in chflags do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7712: checking for $ac_func" >&5 +echo "configure:7713: 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:7741: \"$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 @@ -7764,12 +7765,12 @@ done for ac_func in snprintf vsnprintf gethostid getdomainname do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7768: checking for $ac_func" >&5 +echo "configure:7769: 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:7797: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7820,12 +7821,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:7824: checking for $ac_func" >&5 +echo "configure:7825: 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:7853: \"$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 @@ -7875,12 +7876,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:7879: checking for gethostbyname_r" >&5 +echo "configure:7880: 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:7908: \"$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 @@ -7921,7 +7922,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:7925: checking for gethostbyname_r in -lnsl" >&5 +echo "configure:7926: 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 @@ -7929,7 +7930,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:7945: \"$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 @@ -7968,7 +7969,7 @@ else fi echo $ac_n "checking for gethostbyname_r in -lresolv""... $ac_c" 1>&6 -echo "configure:7972: checking for gethostbyname_r in -lresolv" >&5 +echo "configure:7973: 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 @@ -7976,7 +7977,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:7992: \"$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 @@ -8020,12 +8021,12 @@ fi # Find where sockets are (especially for Solaris) echo $ac_n "checking for socket""... $ac_c" 1>&6 -echo "configure:8024: checking for socket" >&5 +echo "configure:8025: 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:8053: \"$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 @@ -8066,7 +8067,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:8070: checking for socket in -lxnet" >&5 +echo "configure:8071: 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 @@ -8074,7 +8075,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:8090: \"$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 @@ -8113,7 +8114,7 @@ else fi echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6 -echo "configure:8117: checking for socket in -lsocket" >&5 +echo "configure:8118: 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 @@ -8121,7 +8122,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:8137: \"$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 @@ -8160,7 +8161,7 @@ else fi echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6 -echo "configure:8164: checking for socket in -linet" >&5 +echo "configure:8165: 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 @@ -8168,7 +8169,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:8184: \"$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 @@ -8212,12 +8213,12 @@ fi for ac_func in inet_pton do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:8216: checking for $ac_func" >&5 +echo "configure:8217: 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:8245: \"$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 @@ -8269,12 +8270,12 @@ done echo $ac_n "checking for strftime""... $ac_c" 1>&6 -echo "configure:8273: checking for strftime" >&5 +echo "configure:8274: 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:8302: \"$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 @@ -8319,7 +8320,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:8323: checking for strftime in -lintl" >&5 +echo "configure:8324: 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 @@ -8327,7 +8328,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:8343: \"$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 @@ -8365,12 +8366,12 @@ fi fi echo $ac_n "checking for vprintf""... $ac_c" 1>&6 -echo "configure:8369: checking for vprintf" >&5 +echo "configure:8370: 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:8398: \"$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 @@ -8417,12 +8418,12 @@ fi if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:8421: checking for _doprnt" >&5 +echo "configure:8422: 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:8450: \"$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 @@ -8472,19 +8473,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:8476: checking for working alloca.h" >&5 +echo "configure:8477: 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:8488: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8489: \"$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 @@ -8505,12 +8506,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:8509: checking for alloca" >&5 +echo "configure:8510: 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:8543: \"$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 @@ -8570,12 +8571,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:8574: checking whether alloca needs Cray hooks" >&5 +echo "configure:8575: 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:8604: checking for $ac_func" >&5 +echo "configure:8605: 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:8633: \"$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 @@ -8655,7 +8656,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:8659: checking stack direction for C alloca" >&5 +echo "configure:8660: 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 @@ -8663,7 +8664,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:8687: \"$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 @@ -8705,7 +8706,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:8709: checking for getmntent in -lsun" >&5 +echo "configure:8710: 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 @@ -8713,7 +8714,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:8729: \"$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 @@ -8743,7 +8744,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:8747: checking for getmntent in -lseq" >&5 +echo "configure:8748: 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 @@ -8751,7 +8752,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:8767: \"$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 @@ -8781,7 +8782,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:8785: checking for getmntent in -lgen" >&5 +echo "configure:8786: 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 @@ -8789,7 +8790,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:8805: \"$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 @@ -8825,12 +8826,12 @@ fi fi echo $ac_n "checking for getmntent""... $ac_c" 1>&6 -echo "configure:8829: checking for getmntent" >&5 +echo "configure:8830: 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:8858: \"$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 @@ -8876,7 +8877,7 @@ else fi echo $ac_n "checking whether closedir returns void""... $ac_c" 1>&6 -echo "configure:8880: checking whether closedir returns void" >&5 +echo "configure:8881: 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 @@ -8884,13 +8885,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:8894: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8895: \"$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 @@ -8913,7 +8914,7 @@ EOF fi echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6 -echo "configure:8917: checking whether setpgrp takes no argument" >&5 +echo "configure:8918: 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 @@ -8921,7 +8922,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:8946: \"$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 @@ -8964,7 +8965,7 @@ EOF fi echo $ac_n "checking for working fnmatch""... $ac_c" 1>&6 -echo "configure:8968: checking for working fnmatch" >&5 +echo "configure:8969: 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 @@ -8975,11 +8976,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:8984: \"$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 @@ -9004,7 +9005,7 @@ fi echo $ac_n "checking for setlocale in -lxpg4""... $ac_c" 1>&6 -echo "configure:9008: checking for setlocale in -lxpg4" >&5 +echo "configure:9009: 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 @@ -9012,7 +9013,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:9028: \"$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 @@ -9046,7 +9047,7 @@ fi echo $ac_n "checking for getpwnam in -lsun""... $ac_c" 1>&6 -echo "configure:9050: checking for getpwnam in -lsun" >&5 +echo "configure:9051: 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 @@ -9054,7 +9055,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:9070: \"$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 @@ -9097,17 +9098,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:9101: checking for $ac_hdr" >&5 +echo "configure:9102: 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:9111: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9112: \"$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* @@ -9134,7 +9135,7 @@ fi done echo $ac_n "checking for deflate in -lz""... $ac_c" 1>&6 -echo "configure:9138: checking for deflate in -lz" >&5 +echo "configure:9139: 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 @@ -9142,7 +9143,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:9158: \"$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 @@ -9184,7 +9185,7 @@ fi PTHREAD_LIB="" echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 -echo "configure:9188: checking for pthread_create in -lpthread" >&5 +echo "configure:9189: 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 @@ -9192,7 +9193,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:9208: \"$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 @@ -9222,7 +9223,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:9226: checking for pthread_create in -lpthreads" >&5 +echo "configure:9227: 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 @@ -9230,7 +9231,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:9246: \"$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 @@ -9260,7 +9261,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:9264: checking for pthread_create in -lc_r" >&5 +echo "configure:9265: 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 @@ -9268,7 +9269,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:9284: \"$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 @@ -9298,12 +9299,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:9302: checking for pthread_create" >&5 +echo "configure:9303: 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:9331: \"$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 @@ -9420,13 +9421,19 @@ alpha) ;; bsdi) DISTVER=`uname -a |awk '{print $3}'` - TAPEDRIVE="/dev/nrst0" - ;; -caldera) - DISTVER=`cat /etc/.issue | grep Version | cut -f 2 -d ' '` - TAPEDRIVE="/dev/nrst0" - PSCMD="ps -e -o pid,command" + TAPEDRIVE="/dev/nrmt0" + PTHREAD_LIB="-pthread" + CFLAGS="${CFLAGS} -pthread" + PSCMD="ps -x -o pid,command" + lld="qd" + llu="qu" + PFILES="${PFILES} \ + platforms/bsdi/Makefile \ + platforms/bsdi/bacula-fd \ + platforms/bsdi/bacula-sd \ + platforms/bsdi/bacula-dir" hostname=`hostname -s` + largefile_support="yes" ;; cygwin) DISTVER=`uname -a |awk '{print $3}'` @@ -9455,7 +9462,7 @@ freebsd) CFLAGS="${CFLAGS} -pthread" lld="qd" llu="qu" - TAPEDRIVE="/dev/nrst0" + TAPEDRIVE="/dev/nrsa0" PSCMD="ps -x -o pid,command" PFILES="${PFILES} \ platforms/freebsd/Makefile \ diff --git a/bacula/platforms/Makefile.in b/bacula/platforms/Makefile.in index 9b0ba5e2a1..86ea943641 100644 --- a/bacula/platforms/Makefile.in +++ b/bacula/platforms/Makefile.in @@ -11,7 +11,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL = @INSTALL@ -SUBDIRS = freebsd redhat solaris unknown openbsd irix gentoo darwin aix +SUBDIRS = freebsd redhat solaris unknown openbsd irix gentoo darwin aix bsdi MAKE = make diff --git a/bacula/platforms/bsdi/.cvsignore b/bacula/platforms/bsdi/.cvsignore new file mode 100644 index 0000000000..5c9ac8228d --- /dev/null +++ b/bacula/platforms/bsdi/.cvsignore @@ -0,0 +1,5 @@ +bacula-dir +bacula-fd +bacula-sd +Makefile +1 diff --git a/bacula/platforms/bsdi/Makefile.in b/bacula/platforms/bsdi/Makefile.in new file mode 100644 index 0000000000..31a5d7bce5 --- /dev/null +++ b/bacula/platforms/bsdi/Makefile.in @@ -0,0 +1,136 @@ +# +# This file is used as the template to create the +# Makefile for the Solaris specific installation. +# +# 15 November 2001 -- Kern Sibbald +# +# for Bacula release @VERSION@ (@DATE@) -- @DISTNAME@ +# + +VPATH = @srcdir@ +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +SED = /usr/bin/sed + +nothing: + +install: install-autostart + +install-autostart: install-autostart-fd install-autostart-sd install-autostart-dir + + +install-autostart-fd: + @echo "FreeBSD platform installation" + $(INSTALL_PROGRAM) -m 744 bacula-fd /etc/rc.bacula-fd + @-today="`date +%Y%m%d%H%M`"; \ + grep -q /etc/rc.bacula-fd /etc/rc.local; \ + if [ $$? -eq 0 ]; then \ + echo "/etc/rc.local already patched"; \ + else \ + rm -f /etc/rc.local.$$today; \ + cp -p /etc/rc.local /etc/rc.local.$$today; \ + ( echo "Start the Bacula File daemon. Do not remove the 'TAG_BACULA_FD' text"; \ + echo "if [ -x /etc/rc.bacula-fd ]; then # TAG_BACULA_FD"; \ + echo " /etc/rc.bacula-fd start # TAG_BACULA_FD"; \ + echo "fi # TAG_BACULA_FD"; \ + ) >> /etc/rc.local; \ + echo ""; \ + fi + + +install-autostart-sd: + @echo "FreeBSD platform installation" + $(INSTALL_PROGRAM) -m 744 bacula-sd /etc/rc.bacula-sd + @-today="`date +%Y%m%d%H%M`"; \ + grep -q /etc/rc.bacula-sd /etc/rc.local; \ + if [ $$? -eq 0 ]; then \ + echo "/etc/rc.local already patched"; \ + else \ + rm -f /etc/rc.local.$$today; \ + cp -p /etc/rc.local /etc/rc.local.$$today; \ + ( echo "Start the Bacula Storage daemon. Do not remove the 'TAG_BACULA_SD' text"; \ + echo "if [ -x /etc/rc.bacula-fd ]; then # TAG_BACULA_SD"; \ + echo " /etc/rc.bacula-fd start # TAG_BACULA_SD"; \ + echo "fi # TAG_BACULA_SD"; \ + ) >> /etc/rc.local; \ + echo ""; \ + fi + +install-autostart-dir: + @echo "FreeBSD platform installation" + $(INSTALL_PROGRAM) -m 744 bacula-dir /etc/rc.bacula-dir + @-today="`date +%Y%m%d%H%M`"; \ + grep -q /etc/rc.bacula-dir /etc/rc.local; \ + if [ $$? -eq 0 ]; then \ + echo "/etc/rc.local already patched"; \ + else \ + rm -f /etc/rc.local.$$today; \ + cp -p /etc/rc.local /etc/rc.local.$$today; \ + ( echo "Start the Bacula Director. Do not remove the 'TAG_BACULA_DIR' text"; \ + echo "if [ -x /etc/rc.bacula-dir ]; then # TAG_BACULA_DIR"; \ + echo " /etc/rc.bacula-dir start # TAG_BACULA_DIR"; \ + echo "fi # TAG_BACULA_DIR"; \ + ) >> /etc/rc.local; \ + echo ""; \ + fi + + +uninstall: uninstall-autostart + +uninstall-autostart: uninstall-autostart-fd uninstall-autostart-sd uninstall-autostart-dir + +uninstall-autostart-fd: + @echo "FreeBSD platform uninstall" + rm -f /etc/rc.bacula-fd + @-today="`date +%Y%m%d%H%M`"; \ + for f in /etc/rc.local ; do \ + grep -q '# TAG_BACULA_FD' $$f; \ + if [ $$? -eq 0 ]; then \ + echo "removing Bacula lines from $$f"; \ + rm -f $$f.$$today; \ + cp -p $$f $$f.$$today; \ + $(SED) -e '/TAG_BACULA_FD/d;' \ + < $$f.$$today > $$f; \ + chmod 644 $$f; \ + fi; \ + done + + +uninstall-autostart-sd: + @echo "FreeBSD platform uninstall" + rm -f /etc/rc.bacula-sd + @-today="`date +%Y%m%d%H%M`"; \ + for f in /etc/rc.local ; do \ + grep -q '# TAG_BACULA_SD' $$f; \ + if [ $$? -eq 0 ]; then \ + echo "removing Bacula lines from $$f"; \ + rm -f $$f.$$today; \ + cp -p $$f $$f.$$today; \ + $(SED) -e '/TAG_BACULA_SD/d;' \ + < $$f.$$today > $$f; \ + chmod 644 $$f; \ + fi; \ + done + +uninstall-autostart-dir: + @echo "FreeBSD platform uninstall" + rm -f /etc/rc.bacula-dir + @-today="`date +%Y%m%d%H%M`"; \ + for f in /etc/rc.local ; do \ + grep -q '# TAG_BACULA_DIR' $$f; \ + if [ $$? -eq 0 ]; then \ + echo "removing Bacula lines from $$f"; \ + rm -f $$f.$$today; \ + cp -p $$f $$f.$$today; \ + $(SED) -e '/TAG_BACULA_DIR/d;' \ + < $$f.$$today > $$f; \ + chmod 644 $$f; \ + fi; \ + done + +clean: + @rm -f bacula-sd bacula-fd bacula-dir + +distclean: clean + @rm -f Makefile bacula-*.spec + @rm -rf CVS diff --git a/bacula/platforms/bsdi/bacula-dir.in b/bacula/platforms/bsdi/bacula-dir.in new file mode 100755 index 0000000000..8ff091906e --- /dev/null +++ b/bacula/platforms/bsdi/bacula-dir.in @@ -0,0 +1,38 @@ +#! /bin/sh +# +# bacula This shell script takes care of starting and stopping +# the bacula Director daemon +# +# chkconfig: 2345 20 99 +# description: It comes by night and sucks the vital essence from your computers. +# +# For Bacula release @VERSION@ (@DATE@) -- @DISTNAME@ +# + +RETVAL=0 +case "$1" in + start) + echo "Starting the Bacula Director: " + @sbindir@/bacula-dir $2 -c @sysconfdir@/bacula-dir.conf + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch @subsysdir@/bacula-dir + ;; + stop) + echo "Stopping the Director daemon: " +# killproc @sbindir@/bacula-dir + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && rm -f @subsysdir@/bacula-dir + ;; + restart) + $0 stop + sleep 5 + $0 start + ;; + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 + ;; +esac +exit 0 diff --git a/bacula/platforms/bsdi/bacula-fd.in b/bacula/platforms/bsdi/bacula-fd.in new file mode 100755 index 0000000000..9f26adea5d --- /dev/null +++ b/bacula/platforms/bsdi/bacula-fd.in @@ -0,0 +1,37 @@ +#! /bin/sh +# +# bacula This shell script takes care of starting and stopping +# the bacula File daemon. +# +# chkconfig: 2345 20 99 +# description: It comes by night and sucks the vital essence from your computers. +# +# For Bacula release @VERSION@ (@DATE@) -- @DISTNAME@ +# + +case "$1" in + start) + echo "Starting the Bacula File daemon: " + @sbindir@/bacula-fd $2 -c @sysconfdir@/bacula-fd.conf + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch @subsysdir@/bacula-fd + ;; + stop) + echo "Stopping the Bacula File daemon: " +# killproc @sbindir@/bacula-fd + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && rm -f @subsysdir@/bacula-fd + ;; + restart) + $0 stop + sleep 5 + $0 start + ;; + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 + ;; +esac +exit 0 diff --git a/bacula/platforms/bsdi/bacula-sd.in b/bacula/platforms/bsdi/bacula-sd.in new file mode 100755 index 0000000000..79e1a91ee6 --- /dev/null +++ b/bacula/platforms/bsdi/bacula-sd.in @@ -0,0 +1,37 @@ +#! /bin/sh +# +# bacula This shell script takes care of starting and stopping +# the bacula Storage daemon. +# +# chkconfig: 2345 20 99 +# description: It comes by night and sucks the vital essence from your computers. +# +# For Bacula release @VERSION@ (@DATE@) -- @DISTNAME@ +# + +case "$1" in + start) + echo "Starting the Bacula Storage daemon: " + @sbindir@/bacula-sd $2 -c @sysconfdir@/bacula-sd.conf + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch @subsysdir@/bacula-sd + ;; + stop) + echo "Stopping the Bacula Storage daemon: " +# killproc @sbindir@/bacula-sd + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && rm -f @subsysdir@/bacula-sd + ;; + restart) + $0 stop + sleep 5 + $0 start + ;; + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 + ;; +esac +exit 0 diff --git a/bacula/src/lib/protos.h b/bacula/src/lib/protos.h index d5b0e8fd12..058e9c7a08 100644 --- a/bacula/src/lib/protos.h +++ b/bacula/src/lib/protos.h @@ -24,142 +24,144 @@ */ /* base64.c */ -void base64_init (void); -int to_base64 (intmax_t value, char *where); -int from_base64 (intmax_t *value, char *where); -int bin_to_base64 (char *buf, char *bin, int len); +void base64_init (void); +int to_base64 (intmax_t value, char *where); +int from_base64 (intmax_t *value, char *where); +int bin_to_base64 (char *buf, char *bin, int len); /* bmisc.c */ -char *bstrncpy (char *dest, const char *src, int maxlen); -char *bstrncat (char *dest, const char *src, int maxlen); -void *b_malloc (char *file, int line, size_t size); +char *bstrncpy (char *dest, const char *src, int maxlen); +char *bstrncat (char *dest, const char *src, int maxlen); +void *b_malloc (char *file, int line, size_t size); #ifndef DEBUG -void *bmalloc (size_t size); +void *bmalloc (size_t size); +#endif +void *brealloc (void *buf, size_t size); +void *bcalloc (size_t size1, size_t size2); +int bsnprintf (char *str, size_t size, const char *format, ...); +int bvsnprintf (char *str, size_t size, const char *format, va_list ap); +int pool_sprintf (char *pool_buf, char *fmt, ...); +void create_pid_file (char *dir, char *progname, int port); +int delete_pid_file (char *dir, char *progname, int port); +void drop (char *uid, char *gid); +int bmicrosleep (time_t sec, long msec); +#ifndef HAVE_STRTOLL +long long int stroll(const char *ptr, char **endptr, int base); #endif -void *brealloc (void *buf, size_t size); -void *bcalloc (size_t size1, size_t size2); -int bsnprintf (char *str, size_t size, const char *format, ...); -int bvsnprintf (char *str, size_t size, const char *format, va_list ap); -int pool_sprintf (char *pool_buf, char *fmt, ...); -void create_pid_file (char *dir, char *progname, int port); -int delete_pid_file (char *dir, char *progname, int port); -void drop (char *uid, char *gid); -int bmicrosleep (time_t sec, long msec); - /* bnet.c */ -int32_t bnet_recv (BSOCK *bsock); -int bnet_send (BSOCK *bsock); -int bnet_fsend (BSOCK *bs, char *fmt, ...); -int bnet_set_buffer_size (BSOCK *bs, uint32_t size, int rw); -int bnet_sig (BSOCK *bs, int sig); -int bnet_ssl_server (BSOCK *bsock, char *password, int ssl_need, int ssl_has); -int bnet_ssl_client (BSOCK *bsock, char *password, int ssl_need); -BSOCK * bnet_connect (void *jcr, int retry_interval, - int max_retry_time, char *name, char *host, char *service, - int port, int verbose); -void bnet_close (BSOCK *bsock); -BSOCK * init_bsock (void *jcr, int sockfd, char *who, char *ip, int port); -BSOCK * dup_bsock (BSOCK *bsock); -void term_bsock (BSOCK *bsock); -char * bnet_strerror (BSOCK *bsock); -char * bnet_sig_to_ascii (BSOCK *bsock); -int bnet_wait_data (BSOCK *bsock, int sec); -int bnet_wait_data_intr (BSOCK *bsock, int sec); -int bnet_despool (BSOCK *bsock); -int is_bnet_stop (BSOCK *bsock); -int is_bnet_error (BSOCK *bsock); -void bnet_suppress_error_messages(BSOCK *bsock, int flag); +int32_t bnet_recv (BSOCK *bsock); +int bnet_send (BSOCK *bsock); +int bnet_fsend (BSOCK *bs, char *fmt, ...); +int bnet_set_buffer_size (BSOCK *bs, uint32_t size, int rw); +int bnet_sig (BSOCK *bs, int sig); +int bnet_ssl_server (BSOCK *bsock, char *password, int ssl_need, int ssl_has); +int bnet_ssl_client (BSOCK *bsock, char *password, int ssl_need); +BSOCK * bnet_connect (void *jcr, int retry_interval, + int max_retry_time, char *name, char *host, char *service, + int port, int verbose); +void bnet_close (BSOCK *bsock); +BSOCK * init_bsock (void *jcr, int sockfd, char *who, char *ip, int port); +BSOCK * dup_bsock (BSOCK *bsock); +void term_bsock (BSOCK *bsock); +char * bnet_strerror (BSOCK *bsock); +char * bnet_sig_to_ascii (BSOCK *bsock); +int bnet_wait_data (BSOCK *bsock, int sec); +int bnet_wait_data_intr (BSOCK *bsock, int sec); +int bnet_despool (BSOCK *bsock); +int is_bnet_stop (BSOCK *bsock); +int is_bnet_error (BSOCK *bsock); +void bnet_suppress_error_messages(BSOCK *bsock, int flag); /* bget_msg.c */ -int bget_msg(BSOCK *sock); +int bget_msg(BSOCK *sock); /* cram-md5.c */ int cram_md5_get_auth(BSOCK *bs, char *password, int ssl_need); int cram_md5_auth(BSOCK *bs, char *password, int ssl_need); void hmac_md5(uint8_t* text, int text_len, uint8_t* key, - int key_len, uint8_t *hmac); + int key_len, uint8_t *hmac); /* crc32.c */ uint32_t bcrc32(uint8_t *buf, int len); /* daemon.c */ -void daemon_start (); +void daemon_start (); /* edit.c */ -uint64_t str_to_uint64(char *str); -int64_t str_to_int64(char *str); -char * edit_uint64_with_commas (uint64_t val, char *buf); -char * add_commas (char *val, char *buf); -char * edit_uint64 (uint64_t val, char *buf); -int duration_to_utime (char *str, utime_t *value); -int size_to_uint64(char *str, int str_len, uint64_t *rtn_value); -char *edit_utime (utime_t val, char *buf); -int is_a_number (const char *num); -int is_an_integer (const char *n); +uint64_t str_to_uint64(char *str); +int64_t str_to_int64(char *str); +char * edit_uint64_with_commas (uint64_t val, char *buf); +char * add_commas (char *val, char *buf); +char * edit_uint64 (uint64_t val, char *buf); +int duration_to_utime (char *str, utime_t *value); +int size_to_uint64(char *str, int str_len, uint64_t *rtn_value); +char *edit_utime (utime_t val, char *buf); +int is_a_number (const char *num); +int is_an_integer (const char *n); /* lex.c */ -LEX * lex_close_file (LEX *lf); -LEX * lex_open_file (LEX *lf, char *fname, LEX_ERROR_HANDLER *scan_error); -int lex_get_char (LEX *lf); -void lex_unget_char (LEX *lf); -char * lex_tok_to_str (int token); -int lex_get_token (LEX *lf, int expect); +LEX * lex_close_file (LEX *lf); +LEX * lex_open_file (LEX *lf, char *fname, LEX_ERROR_HANDLER *scan_error); +int lex_get_char (LEX *lf); +void lex_unget_char (LEX *lf); +char * lex_tok_to_str (int token); +int lex_get_token (LEX *lf, int expect); /* message.c */ -void my_name_is (int argc, char *argv[], char *name); -void init_msg (void *jcr, MSGS *msg); -void term_msg (void); -void close_msg (void *jcr); -void add_msg_dest (MSGS *msg, int dest, int type, char *where, char *dest_code); -void rem_msg_dest (MSGS *msg, int dest, int type, char *where); -void Jmsg (void *jcr, int type, int level, char *fmt, ...); -void dispatch_message (void *jcr, int type, int level, char *buf); -void init_console_msg (char *wd); -void free_msgs_res (MSGS *msgs); -int open_spool_file (void *jcr, BSOCK *bs); -int close_spool_file (void *vjcr, BSOCK *bs); +void my_name_is (int argc, char *argv[], char *name); +void init_msg (void *jcr, MSGS *msg); +void term_msg (void); +void close_msg (void *jcr); +void add_msg_dest (MSGS *msg, int dest, int type, char *where, char *dest_code); +void rem_msg_dest (MSGS *msg, int dest, int type, char *where); +void Jmsg (void *jcr, int type, int level, char *fmt, ...); +void dispatch_message (void *jcr, int type, int level, char *buf); +void init_console_msg (char *wd); +void free_msgs_res (MSGS *msgs); +int open_spool_file (void *jcr, BSOCK *bs); +int close_spool_file (void *vjcr, BSOCK *bs); /* bnet_server.c */ -void bnet_thread_server(char *bind_addr, int port, int max_clients, workq_t *client_wq, - void *handle_client_request(void *bsock)); -void bnet_server (int port, void handle_client_request(BSOCK *bsock)); -int net_connect (int port); -BSOCK * bnet_bind (int port); -BSOCK * bnet_accept (BSOCK *bsock, char *who); +void bnet_thread_server(char *bind_addr, int port, int max_clients, workq_t *client_wq, + void *handle_client_request(void *bsock)); +void bnet_server (int port, void handle_client_request(BSOCK *bsock)); +int net_connect (int port); +BSOCK * bnet_bind (int port); +BSOCK * bnet_accept (BSOCK *bsock, char *who); /* signal.c */ -void init_signals (void terminate(int sig)); -void init_stack_dump (void); +void init_signals (void terminate(int sig)); +void init_stack_dump (void); /* util.c */ -void lcase (char *str); -void bash_spaces (char *str); -void unbash_spaces (char *str); -void strip_trailing_junk (char *str); -void strip_trailing_slashes (char *dir); -int skip_spaces (char **msg); -int skip_nonspaces (char **msg); -int fstrsch (char *a, char *b); -char * encode_time (time_t time, char *buf); -char * encode_mode (mode_t mode, char *buf); -int do_shell_expansion (char *name); -int is_buf_zero (char *buf, int len); -void jobstatus_to_ascii (int JobStatus, char *msg, int maxlen); -void pm_strcat (POOLMEM **pm, char *str); -void pm_strcpy (POOLMEM **pm, char *str); -int run_program (char *prog, int wait, POOLMEM *results); -char * job_type_to_str (int type); -char * job_status_to_str (int stat); -char * job_level_to_str (int level); -void makeSessionKey (char *key, char *seed, int mode); -BPIPE * open_bpipe(char *prog, int wait, char *mode); -int close_wpipe(BPIPE *bpipe); -int close_bpipe(BPIPE *bpipe); -POOLMEM *edit_job_codes(void *jcr, char *omsg, char *imsg, char *to); +void lcase (char *str); +void bash_spaces (char *str); +void unbash_spaces (char *str); +void strip_trailing_junk (char *str); +void strip_trailing_slashes (char *dir); +int skip_spaces (char **msg); +int skip_nonspaces (char **msg); +int fstrsch (char *a, char *b); +char * encode_time (time_t time, char *buf); +char * encode_mode (mode_t mode, char *buf); +int do_shell_expansion (char *name); +int is_buf_zero (char *buf, int len); +void jobstatus_to_ascii (int JobStatus, char *msg, int maxlen); +void pm_strcat (POOLMEM **pm, char *str); +void pm_strcpy (POOLMEM **pm, char *str); +int run_program (char *prog, int wait, POOLMEM *results); +char * job_type_to_str (int type); +char * job_status_to_str (int stat); +char * job_level_to_str (int level); +void makeSessionKey (char *key, char *seed, int mode); +BPIPE * open_bpipe(char *prog, int wait, char *mode); +int close_wpipe(BPIPE *bpipe); +int close_bpipe(BPIPE *bpipe); +POOLMEM *edit_job_codes(void *jcr, char *omsg, char *imsg, char *to); void parse_command_args(POOLMEM *cmd, POOLMEM *args, int *argc, - char **argk, char **argv); + char **argk, char **argv); char *next_arg(char **s); diff --git a/bacula/src/stored/butil.c b/bacula/src/stored/butil.c index dd9343c5a1..8c1b9996af 100644 --- a/bacula/src/stored/butil.c +++ b/bacula/src/stored/butil.c @@ -240,15 +240,15 @@ void display_error_status(DEVICE *dev) Emsg0(M_ERROR, 0, dev->errmsg); status_dev(dev, &status); Dmsg1(20, "Device status: %x\n", status); - if (status & MT_EOD) + if (status & BMT_EOD) Emsg0(M_ERROR_TERM, 0, _("Unexpected End of Data\n")); - else if (status & MT_EOT) + else if (status & BMT_EOT) Emsg0(M_ERROR_TERM, 0, _("Unexpected End of Tape\n")); - else if (status & MT_EOF) + else if (status & BMT_EOF) Emsg0(M_ERROR_TERM, 0, _("Unexpected End of File\n")); - else if (status & MT_DR_OPEN) + else if (status & BMT_DR_OPEN) Emsg0(M_ERROR_TERM, 0, _("Tape Door is Open\n")); - else if (!(status & MT_ONLINE)) + else if (!(status & BMT_ONLINE)) Emsg0(M_ERROR_TERM, 0, _("Unexpected Tape is Off-line\n")); else Emsg2(M_ERROR_TERM, 0, _("Read error on Record Header %s: %s\n"), dev_name(dev), strerror(errno)); diff --git a/bacula/src/stored/dev.c b/bacula/src/stored/dev.c index 86799f5f53..5bccfb6f82 100644 --- a/bacula/src/stored/dev.c +++ b/bacula/src/stored/dev.c @@ -516,15 +516,15 @@ status_dev(DEVICE *dev, uint32_t *status) uint32_t stat = 0; if (dev->state & (ST_EOT | ST_WEOT)) { - stat |= MT_EOD; + stat |= BMT_EOD; Dmsg0(-20, " EOD"); } if (dev->state & ST_EOF) { - stat |= MT_EOF; + stat |= BMT_EOF; Dmsg0(-20, " EOF"); } if (dev->state & ST_TAPE) { - stat |= MT_TAPE; + stat |= BMT_TAPE; Dmsg0(-20," Driver status:"); Dmsg2(-20," file=%d block=%d\n", dev->file, dev->block_num); if (ioctl(dev->fd, MTIOCGET, (char *)&mt_stat) < 0) { @@ -537,45 +537,45 @@ status_dev(DEVICE *dev, uint32_t *status) #if defined(HAVE_LINUX_OS) if (GMT_EOF(mt_stat.mt_gstat)) { - stat |= MT_EOF; + stat |= BMT_EOF; Dmsg0(-20, " EOF"); } if (GMT_BOT(mt_stat.mt_gstat)) { - stat |= MT_BOT; + stat |= BMT_BOT; Dmsg0(-20, " BOT"); } if (GMT_EOT(mt_stat.mt_gstat)) { - stat |= MT_EOT; + stat |= BMT_EOT; Dmsg0(-20, " EOT"); } if (GMT_SM(mt_stat.mt_gstat)) { - stat |= MT_SM; + stat |= BMT_SM; Dmsg0(-20, " SM"); } if (GMT_EOD(mt_stat.mt_gstat)) { - stat |= MT_EOD; + stat |= BMT_EOD; Dmsg0(-20, " EOD"); } if (GMT_WR_PROT(mt_stat.mt_gstat)) { - stat |= MT_WR_PROT; + stat |= BMT_WR_PROT; Dmsg0(-20, " WR_PROT"); } if (GMT_ONLINE(mt_stat.mt_gstat)) { - stat |= MT_ONLINE; + stat |= BMT_ONLINE; Dmsg0(-20, " ONLINE"); } if (GMT_DR_OPEN(mt_stat.mt_gstat)) { - stat |= MT_DR_OPEN; + stat |= BMT_DR_OPEN; Dmsg0(-20, " DR_OPEN"); } if (GMT_IM_REP_EN(mt_stat.mt_gstat)) { - stat |= MT_IM_REP_EN; + stat |= BMT_IM_REP_EN; Dmsg0(-20, " IM_REP_EN"); } #endif /* !SunOS && !OSF */ Dmsg2(-20, " file=%d block=%d\n", mt_stat.mt_fileno, mt_stat.mt_blkno); } else { - stat |= MT_ONLINE | MT_BOT; + stat |= BMT_ONLINE | BMT_BOT; } *status = stat; return 1; @@ -743,7 +743,7 @@ fsf_dev(DEVICE *dev, int num) dev->state &= ~(ST_EOF|ST_EOT); } - Dmsg0(200, "Doing MT_FSF\n"); + Dmsg0(200, "Doing MTFSF\n"); stat = ioctl(dev->fd, MTIOCTOP, (char *)&mt_com); if (stat < 0) { /* error => EOT */ dev->state |= ST_EOT; @@ -751,7 +751,7 @@ fsf_dev(DEVICE *dev, int num) clrerror_dev(dev, MTFSF); Mmsg2(&dev->errmsg, _("ioctl MTFSF error on %s. ERR=%s.\n"), dev->dev_name, strerror(dev->dev_errno)); - Dmsg0(200, "Got < 0 for MT_FSF\n"); + Dmsg0(200, "Got < 0 for MTFSF\n"); Dmsg1(200, "%s", dev->errmsg); } else { dev->state |= ST_EOF; /* just read EOF */ diff --git a/bacula/src/stored/dev.h b/bacula/src/stored/dev.h index 4bcc54b778..6ebdb310fe 100644 --- a/bacula/src/stored/dev.h +++ b/bacula/src/stored/dev.h @@ -50,16 +50,16 @@ #define OPEN_WRITE_ONLY 2 /* Generic status bits returned from status_dev() */ -#define MT_TAPE (1<<0) /* is tape device */ -#define MT_EOF (1<<1) /* just read EOF */ -#define MT_BOT (1<<2) /* at beginning of tape */ -#define MT_EOT (1<<3) /* end of tape reached */ -#define MT_SM (1<<4) /* DDS setmark */ -#define MT_EOD (1<<5) /* DDS at end of data */ -#define MT_WR_PROT (1<<6) /* tape write protected */ -#define MT_ONLINE (1<<7) /* tape online */ -#define MT_DR_OPEN (1<<8) /* tape door open */ -#define MT_IM_REP_EN (1<<9) /* immediate report enabled */ +#define BMT_TAPE (1<<0) /* is tape device */ +#define BMT_EOF (1<<1) /* just read EOF */ +#define BMT_BOT (1<<2) /* at beginning of tape */ +#define BMT_EOT (1<<3) /* end of tape reached */ +#define BMT_SM (1<<4) /* DDS setmark */ +#define BMT_EOD (1<<5) /* DDS at end of data */ +#define BMT_WR_PROT (1<<6) /* tape write protected */ +#define BMT_ONLINE (1<<7) /* tape online */ +#define BMT_DR_OPEN (1<<8) /* tape door open */ +#define BMT_IM_REP_EN (1<<9) /* immediate report enabled */ /* Test capabilities */ diff --git a/bacula/src/stored/device.c b/bacula/src/stored/device.c index b07756a617..9c34ea667c 100644 --- a/bacula/src/stored/device.c +++ b/bacula/src/stored/device.c @@ -79,7 +79,7 @@ int fixup_device_block_write_error(JCR *jcr, DEVICE *dev, DEV_BLOCK *block) wait_time = time(NULL); status_dev(dev, &stat); - if (stat & MT_EOD) { + if (stat & BMT_EOD) { Dmsg0(100, "======= Got EOD ========\n"); block_device(dev, BST_DOING_ACQUIRE);