From: Kern Sibbald Date: Thu, 17 Jun 2004 10:50:05 +0000 (+0000) Subject: Restructure tree.c + misc X-Git-Tag: Release-1.35.1~105 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=873b3b1317c7ab62435a4d60113e5f87e149a232;p=bacula%2Fbacula Restructure tree.c + misc git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1424 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/autoconf/configure.in b/bacula/autoconf/configure.in index eccacfec29..7818f6e74e 100644 --- a/bacula/autoconf/configure.in +++ b/bacula/autoconf/configure.in @@ -327,6 +327,8 @@ AC_ARG_ENABLE(client-only, [ --enable-client-only build client (File daemon) only [disabled]], [if test x$enableval = xyes; then build_client_only=yes + db_name=None + DB_NAME=none fi]) if test x$build_client_only = xno; then ALL_DIRS="subdirs" @@ -1745,12 +1747,26 @@ if test "x${subsysdir}" = "x${sbindir}" ; then echo "You have set --sbindir and --with-subsys-dir" echo " both equal to: ${subsysdir} " echo " This is not permitted. Please reconfigure." + echo " " echo "Aborting configuration ..." echo " " echo " " exit 1 fi +if test "x${db_name}" = "xInternal" ; then + echo " " + echo " " + echo "You have not specified either --enable-client-only or one of the" + echo " supported databases: MySQL, PostgreSQL, or SQLite". + echo " This is not permitted. Please reconfigure." + echo " " + echo "Aborting the configuration ..." + echo " " + echo " " + exit 1 +fi + echo " Configuration on `date`: diff --git a/bacula/configure b/bacula/configure index ab0d125729..a445d54ecf 100755 --- a/bacula/configure +++ b/bacula/configure @@ -4859,6 +4859,8 @@ if test "${enable_client_only+set}" = set; then enableval="$enable_client_only" if test x$enableval = xyes; then build_client_only=yes + db_name=None + DB_NAME=none fi fi; if test x$build_client_only = xno; then @@ -19811,12 +19813,26 @@ if test "x${subsysdir}" = "x${sbindir}" ; then echo "You have set --sbindir and --with-subsys-dir" echo " both equal to: ${subsysdir} " echo " This is not permitted. Please reconfigure." + echo " " echo "Aborting configuration ..." echo " " echo " " exit 1 fi +if test "x${db_name}" = "xInternal" ; then + echo " " + echo " " + echo "You have not specified either --enable-client-only or one of the" + echo " supported databases: MySQL, PostgreSQL, or SQLite". + echo " This is not permitted. Please reconfigure." + echo " " + echo "Aborting the configuration ..." + echo " " + echo " " + exit 1 +fi + echo " Configuration on `date`: diff --git a/bacula/kernstodo b/bacula/kernstodo index dbebad1ad1..6aab00fe4b 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -13,7 +13,8 @@ The BACULA-FD file is linked to missing export KERNEL32.DLL:GetFileAttributesExA. - Add link to doc in message when authentication fails. -- Add db_ensure...slot_unique to BDB. +- Disallow using Internal database +- Add better error codes to run_program (10000+) Documentation to do: (any release a little bit at a time) diff --git a/bacula/platforms/slackware/functions.bacula.in b/bacula/platforms/slackware/functions.bacula.in index b2054fbd16..11fe45f9f1 100644 --- a/bacula/platforms/slackware/functions.bacula.in +++ b/bacula/platforms/slackware/functions.bacula.in @@ -1,7 +1,7 @@ #! /bin/sh # # bacula This shell script takes care of starting and stopping -# the bacula daemons. +# the bacula daemons. # # This is pretty much watered down version of the RedHat script # that works on Solaris as well as Linux, but it won't work everywhere. @@ -40,17 +40,17 @@ killproc() { RC=0 # Test syntax. if [ $# = 0 ]; then - echo "Usage: killproc {program} [signal]" - return 1 + echo "Usage: killproc {program} [signal]" + return 1 fi notset=0 # check for third arg to be kill level if [ "$3" != "" ] ; then - killlevel=$3 + killlevel=$3 else - notset=1 - killlevel="-9" + notset=1 + killlevel="-9" fi # Get base program name @@ -61,39 +61,39 @@ killproc() { # Kill it. if [ "$pid" != "" ] ; then - if [ "$notset" = "1" ] ; then - if ps -p $pid>/dev/null 2>&1; then - # TERM first, then KILL if not dead - kill -TERM $pid 2>/dev/null - sleep 1 - if ps -p $pid >/dev/null 2>&1 ; then - sleep 1 - if ps -p $pid >/dev/null 2>&1 ; then - sleep 3 - if ps -p $pid >/dev/null 2>&1 ; then - kill -KILL $pid 2>/dev/null - fi - fi - fi - fi - ps -p $pid >/dev/null 2>&1 - RC=$? - [ $RC -eq 0 ] && failure "$base shutdown" || success "$base shutdown" - # RC=$((! $RC)) - # use specified level only - else - if ps -p $pid >/dev/null 2>&1; then - kill $killlevel $pid 2>/dev/null - RC=$? - [ $RC -eq 0 ] && success "$base $killlevel" || failure "$base $killlevel" - fi - fi + if [ "$notset" = "1" ] ; then + if ps -p $pid>/dev/null 2>&1; then + # TERM first, then KILL if not dead + kill -TERM $pid 2>/dev/null + sleep 1 + if ps -p $pid >/dev/null 2>&1 ; then + sleep 1 + if ps -p $pid >/dev/null 2>&1 ; then + sleep 3 + if ps -p $pid >/dev/null 2>&1 ; then + kill -KILL $pid 2>/dev/null + fi + fi + fi + fi + ps -p $pid >/dev/null 2>&1 + RC=$? + [ $RC -eq 0 ] && failure "$base shutdown" || success "$base shutdown" + # RC=$((! $RC)) + # use specified level only + else + if ps -p $pid >/dev/null 2>&1; then + kill $killlevel $pid 2>/dev/null + RC=$? + [ $RC -eq 0 ] && success "$base $killlevel" || failure "$base $killlevel" + fi + fi else - failure "$base shutdown" + failure "$base shutdown" fi # Remove pid file if any. if [ "$notset" = "1" ]; then - rm -f ${PIDDIR}/$base.$2.pid + rm -f ${PIDDIR}/$base.$2.pid fi return $RC } @@ -103,8 +103,8 @@ pidofproc() { pid="" # Test syntax. if [ $# = 0 ] ; then - echo "Usage: pidofproc {program}" - return 1 + echo "Usage: pidofproc {program}" + return 1 fi # Get base program name @@ -112,11 +112,11 @@ pidofproc() { # First try PID file if [ -f ${PIDDIR}/$base.$2.pid ] ; then - pid=`head -1 ${PIDDIR}/$base.$2.pid` - if [ "$pid" != "" ] ; then - echo $pid - return 0 - fi + pid=`head -1 ${PIDDIR}/$base.$2.pid` + if [ "$pid" != "" ] ; then + echo $pid + return 0 + fi fi # Next try "pidof" @@ -136,8 +136,8 @@ pidofproc() { status() { # Test syntax. if [ $# = 0 ] ; then - echo "Usage: status {program}" - return 1 + echo "Usage: status {program}" + return 1 fi # Get base program name @@ -152,27 +152,27 @@ status() { return 0 else pid=`${PSCMD} | awk 'BEGIN { prog=ARGV[1]; ARGC=1 } - { if ((prog == $2) || (("(" prog ")") == $2) || - (("[" prog "]") == $2) || - ((prog ":") == $2)) { print $1 ; exit 0 } }' $1` + { if ((prog == $2) || (("(" prog ")") == $2) || + (("[" prog "]") == $2) || + ((prog ":") == $2)) { print $1 ; exit 0 } }' $1` if [ "$pid" != "" ] ; then - echo "$base (pid $pid) is running..." - return 0 + echo "$base (pid $pid) is running..." + return 0 fi fi # Next try the PID files if [ -f ${PIDDIR}/$base.$2.pid ] ; then - pid=`head -1 ${PIDDIR}/$base.$2.pid` - if [ "$pid" != "" ] ; then - echo "$base dead but pid file exists" - return 1 - fi + pid=`head -1 ${PIDDIR}/$base.$2.pid` + if [ "$pid" != "" ] ; then + echo "$base not running, but pid file exists" + return 1 + fi fi # See if the subsys lock exists if [ -f ${SUBSYSDIR}/$base ] ; then - echo "$base dead but subsys locked" - return 2 + echo "$base not running, but subsys locked" + return 2 fi echo "$base is stopped" return 3 @@ -187,4 +187,3 @@ failure() { return $rc } - diff --git a/bacula/platforms/suse/bacula.in b/bacula/platforms/suse/bacula.in index 832ec050f3..1c7545d33f 100644 --- a/bacula/platforms/suse/bacula.in +++ b/bacula/platforms/suse/bacula.in @@ -1,7 +1,7 @@ #! /bin/sh # # bacula This shell script takes care of starting and stopping -# the bacula daemons. +# the bacula daemons. # # This is pretty much watered down version of the RedHat script # that works on Solaris as well as Linux, but it won't work everywhere. @@ -12,12 +12,12 @@ # description: It comes by night and sucks the vital essence from your computers. # ### BEGIN INIT INFO -# Provides: bacula -# Required-Start: network mysql +# Provides: bacula +# Required-Start: network mysql # Required-Stop: -# Default-Start: 2 3 5 +# Default-Start: 2 3 5 # Default-Stop: -# Description: run bacula daemon(s) +# Description: run bacula daemon(s) ### END INIT INFO PSCMD="@PSCMD@" @@ -29,17 +29,17 @@ killproc() { RC=0 # Test syntax. if [ $# = 0 ]; then - echo "Usage: killproc {program} [signal]" - return 1 + echo "Usage: killproc {program} [signal]" + return 1 fi notset=0 # check for third arg to be kill level if [ "$3" != "" ] ; then - killlevel=$3 + killlevel=$3 else - notset=1 - killlevel="-9" + notset=1 + killlevel="-9" fi # Get base program name @@ -50,39 +50,39 @@ killproc() { # Kill it. if [ "$pid" != "" ] ; then - if [ "$notset" = "1" ] ; then - if ps -p $pid>/dev/null 2>&1; then - # TERM first, then KILL if not dead - kill -TERM $pid 2>/dev/null - sleep 1 - if ps -p $pid >/dev/null 2>&1 ; then - sleep 1 - if ps -p $pid >/dev/null 2>&1 ; then - sleep 3 - if ps -p $pid >/dev/null 2>&1 ; then - kill -KILL $pid 2>/dev/null - fi - fi - fi - fi - ps -p $pid >/dev/null 2>&1 - RC=$? - [ $RC -eq 0 ] && failure "$base shutdown" || success "$base shutdown" - # RC=$((! $RC)) - # use specified level only - else - if ps -p $pid >/dev/null 2>&1; then - kill $killlevel $pid 2>/dev/null - RC=$? - [ $RC -eq 0 ] && success "$base $killlevel" || failure "$base $killlevel" - fi - fi + if [ "$notset" = "1" ] ; then + if ps -p $pid>/dev/null 2>&1; then + # TERM first, then KILL if not dead + kill -TERM $pid 2>/dev/null + sleep 1 + if ps -p $pid >/dev/null 2>&1 ; then + sleep 1 + if ps -p $pid >/dev/null 2>&1 ; then + sleep 3 + if ps -p $pid >/dev/null 2>&1 ; then + kill -KILL $pid 2>/dev/null + fi + fi + fi + fi + ps -p $pid >/dev/null 2>&1 + RC=$? + [ $RC -eq 0 ] && failure "$base shutdown" || success "$base shutdown" + # RC=$((! $RC)) + # use specified level only + else + if ps -p $pid >/dev/null 2>&1; then + kill $killlevel $pid 2>/dev/null + RC=$? + [ $RC -eq 0 ] && success "$base $killlevel" || failure "$base $killlevel" + fi + fi else - failure "$base shutdown" + failure "$base shutdown" fi # Remove pid file if any. if [ "$notset" = "1" ]; then - rm -f ${PIDDIR}/$base.$2.pid + rm -f ${PIDDIR}/$base.$2.pid fi return $RC } @@ -92,8 +92,8 @@ pidofproc() { pid="" # Test syntax. if [ $# = 0 ] ; then - echo "Usage: pidofproc {program}" - return 1 + echo "Usage: pidofproc {program}" + return 1 fi # Get base program name @@ -101,11 +101,11 @@ pidofproc() { # First try PID file if [ -f ${PIDDIR}/$base.$2.pid ] ; then - pid=`head -1 ${PIDDIR}/$base.$2.pid` - if [ "$pid" != "" ] ; then - echo $pid - return 0 - fi + pid=`head -1 ${PIDDIR}/$base.$2.pid` + if [ "$pid" != "" ] ; then + echo $pid + return 0 + fi fi # Next try "pidof" @@ -125,8 +125,8 @@ pidofproc() { status() { # Test syntax. if [ $# = 0 ] ; then - echo "Usage: status {program}" - return 1 + echo "Usage: status {program}" + return 1 fi # Get base program name @@ -141,27 +141,27 @@ status() { return 0 else pid=`${PSCMD} | awk 'BEGIN { prog=ARGV[1]; ARGC=1 } - { if ((prog == $2) || (("(" prog ")") == $2) || - (("[" prog "]") == $2) || - ((prog ":") == $2)) { print $1 ; exit 0 } }' $1` + { if ((prog == $2) || (("(" prog ")") == $2) || + (("[" prog "]") == $2) || + ((prog ":") == $2)) { print $1 ; exit 0 } }' $1` if [ "$pid" != "" ] ; then - echo "$base (pid $pid) is running..." - return 0 + echo "$base (pid $pid) is running..." + return 0 fi fi # Next try the PID files if [ -f ${PIDDIR}/$base.$2.pid ] ; then - pid=`head -1 ${PIDDIR}/$base.$2.pid` - if [ "$pid" != "" ] ; then - echo "$base dead but pid file exists" - return 1 - fi + pid=`head -1 ${PIDDIR}/$base.$2.pid` + if [ "$pid" != "" ] ; then + echo "$base not running, but pid file exists" + return 1 + fi fi # See if the subsys lock exists if [ -f ${SUBSYSDIR}/$base ] ; then - echo "$base dead but subsys locked" - return 2 + echo "$base not running, but subsys locked" + return 2 fi echo "$base is stopped" return 3 diff --git a/bacula/scripts/bacula.in b/bacula/scripts/bacula.in index bfcafbbd9d..9f3b21070e 100755 --- a/bacula/scripts/bacula.in +++ b/bacula/scripts/bacula.in @@ -112,7 +112,7 @@ pidofproc() { # First try PID file if [ -f ${PIDDIR}/$base.$2.pid ] ; then - pid=`head -1 ${PIDDIR}/$base.$2.pid` + pid=`head -n 1 ${PIDDIR}/$base.$2.pid` if [ "$pid" != "" ] ; then echo $pid return 0 @@ -163,7 +163,7 @@ status() { # Next try the PID files if [ -f ${PIDDIR}/$base.$2.pid ] ; then - pid=`head -1 ${PIDDIR}/$base.$2.pid` + pid=`head -n 1 ${PIDDIR}/$base.$2.pid` if [ "$pid" != "" ] ; then echo "$base dead but pid file exists" return 1 diff --git a/bacula/src/console/Makefile.in b/bacula/src/console/Makefile.in index d832e5507b..e3b44e6f3c 100644 --- a/bacula/src/console/Makefile.in +++ b/bacula/src/console/Makefile.in @@ -45,11 +45,11 @@ all: Makefile bconsole @STATIC_CONS@ bconsole: $(CONSOBJS) ../lib/libbac.a $(CXX) $(LDFLAGS) $(CONS_LDFLAGS) -L../lib -L../cats -o $@ $(CONSOBJS) \ - $(LIBS) $(DLIB) $(CONS_LIBS) -lbac -lm + $(DLIB) $(CONS_LIBS) -lbac -lm $(LIBS) static-bconsole: $(CONSOBJS) ../lib/libbac.a $(CXX) -static $(LDFLAGS) $(CONS_LDFLAGS) -L../lib -L../cats -o $@ $(CONSOBJS) \ - $(LIBS) $(DLIB) $(CONS_LIBS) -lbac -lm + $(DLIB) $(CONS_LIBS) -lbac -lm $(LIBS) strip $@ diff --git a/bacula/src/dird/Makefile.in b/bacula/src/dird/Makefile.in index c2ecac92c3..b12a0a51cf 100644 --- a/bacula/src/dird/Makefile.in +++ b/bacula/src/dird/Makefile.in @@ -66,11 +66,11 @@ all: Makefile bacula-dir @STATIC_DIR@ bacula-dir: $(SVROBJS) ../lib/libbac.a ../cats/libsql.a ../findlib/libfind.a $(CXX) $(WLDFLAGS) $(LDFLAGS) -L../lib -L../cats -L../findlib -o $@ $(SVROBJS) \ - -lsql -lbac -lfind -lm $(LIBS) $(DLIB) $(DB_LIBS) + -lsql -lbac -lfind -lm $(DLIB) $(DB_LIBS) $(LIBS) static-bacula-dir: $(SVROBJS) ../lib/libbac.a ../cats/libsql.a ../findlib/libfind.a $(CXX) $(WLDFLAGS) $(LDFLAGS) -static -L../lib -L../cats -L../findlib -o $@ $(SVROBJS) \ - -lsql -lbac -lfind -lm $(LIBS) $(DLIB) $(DB_LIBS) + -lsql -lbac -lfind -lm $(DLIB) $(DB_LIBS) $(LIBS) strip $@ diff --git a/bacula/src/dird/ua_restore.c b/bacula/src/dird/ua_restore.c index f2046c3b46..c976e84540 100644 --- a/bacula/src/dird/ua_restore.c +++ b/bacula/src/dird/ua_restore.c @@ -701,17 +701,13 @@ static bool build_directory_tree(UAContext *ua, RESTORE_CTX *rx) TREE_CTX tree; JobId_t JobId, last_JobId; char *p; - char empty = '\0'; - char *nofname; bool OK = true; - nofname = ∅ memset(&tree, 0, sizeof(TREE_CTX)); /* * Build the directory tree containing JobIds user selected */ tree.root = new_tree(rx->TotalFiles); - tree.root->fname = nofname; tree.ua = ua; tree.all = rx->all; last_JobId = 0; diff --git a/bacula/src/dird/ua_tree.c b/bacula/src/dird/ua_tree.c index f731994db6..52de814f4e 100644 --- a/bacula/src/dird/ua_tree.c +++ b/bacula/src/dird/ua_tree.c @@ -151,10 +151,9 @@ int insert_tree_handler(void *ctx, int num_fields, char **row) { struct stat statp; TREE_CTX *tree = (TREE_CTX *)ctx; - char fname[5000]; - TREE_NODE *node, *new_node; + TREE_NODE *node; int type; - bool hard_link, first_time, ok; + bool hard_link, ok; int FileIndex; JobId_t JobId; @@ -168,28 +167,13 @@ int insert_tree_handler(void *ctx, int num_fields, char **row) } else { type = TN_FILE; } - if (tree->avail_node) { - node = tree->avail_node; /* if prev node avail use it */ - } else { - node = new_tree_node(tree->root, type); /* get new node */ - tree->avail_node = node; - } hard_link = (decode_LinkFI(row[4], &statp) != 0); - bsnprintf(fname, sizeof(fname), "%s%s%s", row[0], row[1], ""); - Dmsg3(200, "FI=%d type=%d fname=%s\n", node->FileIndex, type, fname); - new_node = insert_tree_node(fname, node, tree->root, NULL); + node = insert_tree_node(row[0], row[1], NULL, tree->root, NULL); /* Note, if node already exists, save new one for next time */ - if (new_node != node) { - first_time = false; /* we saw this file before */ - tree->avail_node = node; /* node already exists */ - } else { - first_time = true; /* first time we saw this file */ - tree->avail_node = NULL; /* added node to tree */ - } JobId = (JobId_t)str_to_int64(row[3]); FileIndex = atoi(row[2]); /* - * - The first time we see a file, we accept it. + * - The first time we see a file (node->inserted==true), we accept it. * - In the same JobId, we accept only the first copy of a * hard linked file (the others are simply pointers). * - In the same JobId, we accept the last copy of any other @@ -199,22 +183,22 @@ int insert_tree_handler(void *ctx, int num_fields, char **row) * line, but it would be even harder to read. */ ok = true; - if (!first_time && JobId == new_node->JobId) { - if ((hard_link && FileIndex > new_node->FileIndex) || - (!hard_link && FileIndex < new_node->FileIndex)) { + if (!node->inserted && JobId == node->JobId) { + if ((hard_link && FileIndex > node->FileIndex) || + (!hard_link && FileIndex < node->FileIndex)) { ok = false; } } if (ok) { - new_node->hard_link = hard_link; - new_node->FileIndex = FileIndex; - new_node->JobId = JobId; - new_node->type = type; - new_node->soft_link = S_ISLNK(statp.st_mode) != 0; + node->hard_link = hard_link; + node->FileIndex = FileIndex; + node->JobId = JobId; + node->type = type; + node->soft_link = S_ISLNK(statp.st_mode) != 0; if (tree->all) { - new_node->extract = true; /* extract all by default */ + node->extract = true; /* extract all by default */ if (type == TN_DIR || type == TN_DIR_NLS) { - new_node->extract_dir = true; /* if dir, extract it */ + node->extract_dir = true; /* if dir, extract it */ } } } @@ -243,9 +227,9 @@ static int set_extract(UAContext *ua, TREE_NODE *node, TREE_CTX *tree, bool extr count++; } /* For a non-file (i.e. directory), we see all the children */ - if (node->type != TN_FILE || (node->soft_link && node->child)) { + if (node->type != TN_FILE || (node->soft_link && tree_node_has_child(node))) { /* Recursive set children within directory */ - for (n=node->child; n; n=n->sibling) { + foreach_child(n, node) { count += set_extract(ua, n, tree, extract); } /* @@ -301,12 +285,12 @@ static int markcmd(UAContext *ua, TREE_CTX *tree) TREE_NODE *node; int count = 0; - if (ua->argc < 2 || !tree->node->child) { + if (ua->argc < 2 || !tree_node_has_child(tree->node)) { bsendmsg(ua, _("No files marked.\n")); return 1; } for (int i=1; i < ua->argc; i++) { - for (node = tree->node->child; node; node=node->sibling) { + foreach_child(node, tree->node) { if (fnmatch(ua->argk[i], node->fname, 0) == 0) { count += set_extract(ua, node, tree, true); } @@ -325,12 +309,12 @@ static int markdircmd(UAContext *ua, TREE_CTX *tree) TREE_NODE *node; int count = 0; - if (ua->argc < 2 || !tree->node->child) { + if (ua->argc < 2 || !tree_node_has_child(tree->node)) { bsendmsg(ua, _("No files marked.\n")); return 1; } for (int i=1; i < ua->argc; i++) { - for (node = tree->node->child; node; node=node->sibling) { + foreach_child(node, tree->node) { if (fnmatch(ua->argk[i], node->fname, 0) == 0) { if (node->type == TN_DIR || node->type == TN_DIR_NLS) { node->extract_dir = true; @@ -399,10 +383,10 @@ static int lscmd(UAContext *ua, TREE_CTX *tree) { TREE_NODE *node; - if (!tree->node->child) { + if (!tree_node_has_child(tree->node)) { return 1; } - for (node = tree->node->child; node; node=node->sibling) { + foreach_child(node, tree->node) { if (ua->argc == 1 || fnmatch(ua->argk[1], node->fname, 0) == 0) { const char *tag; if (node->extract) { @@ -412,7 +396,7 @@ static int lscmd(UAContext *ua, TREE_CTX *tree) } else { tag = ""; } - bsendmsg(ua, "%s%s%s\n", tag, node->fname, node->child?"/":""); + bsendmsg(ua, "%s%s%s\n", tag, node->fname, tree_node_has_child(node)?"/":""); } } return 1; @@ -423,10 +407,10 @@ static int lscmd(UAContext *ua, TREE_CTX *tree) */ static void rlsmark(UAContext *ua, TREE_NODE *node) { - if (!node->child) { + if (!tree_node_has_child(node)) { return; } - for (node = node->child; node; node=node->sibling) { + foreach_child(node, node) { if ((ua->argc == 1 || fnmatch(ua->argk[1], node->fname, 0) == 0) && (node->extract || node->extract_dir)) { const char *tag; @@ -437,8 +421,8 @@ static void rlsmark(UAContext *ua, TREE_NODE *node) } else { tag = ""; } - bsendmsg(ua, "%s%s%s\n", tag, node->fname, node->child?"/":""); - if (node->child) { + bsendmsg(ua, "%s%s%s\n", tag, node->fname, tree_node_has_child(node)?"/":""); + if (tree_node_has_child(node)) { rlsmark(ua, node); } } @@ -494,10 +478,12 @@ static int dircmd(UAContext *ua, TREE_CTX *tree) char buf[1100]; char cwd[1100], *pcwd; - if (!tree->node->child) { + if (!tree_node_has_child(tree->node)) { + bsendmsg(ua, "Node %s has no children.\n", tree->node->fname); return 1; } - for (node = tree->node->child; node; node=node->sibling) { + + foreach_child(node, tree->node) { const char *tag; if (ua->argc == 1 || fnmatch(ua->argk[1], node->fname, 0) == 0) { if (node->extract) { @@ -517,7 +503,7 @@ static int dircmd(UAContext *ua, TREE_CTX *tree) * treats soft links as files, so they do not have a trailing * slash like directory names. */ - if (node->type == TN_FILE && node->child) { + if (node->type == TN_FILE && tree_node_has_child(node)) { bstrncpy(buf, cwd, sizeof(buf)); pcwd = buf; int len = strlen(buf); @@ -642,12 +628,12 @@ static int unmarkcmd(UAContext *ua, TREE_CTX *tree) TREE_NODE *node; int count = 0; - if (ua->argc < 2 || !tree->node->child) { + if (ua->argc < 2 || !tree_node_has_child(tree->node)) { bsendmsg(ua, _("No files unmarked.\n")); return 1; } for (int i=1; i < ua->argc; i++) { - for (node = tree->node->child; node; node=node->sibling) { + foreach_child(node, tree->node) { if (fnmatch(ua->argk[i], node->fname, 0) == 0) { count += set_extract(ua, node, tree, false); } @@ -666,13 +652,13 @@ static int unmarkdircmd(UAContext *ua, TREE_CTX *tree) TREE_NODE *node; int count = 0; - if (ua->argc < 2 || !tree->node->child) { + if (ua->argc < 2 || !tree_node_has_child(tree->node)) { bsendmsg(ua, _("No directories unmarked.\n")); return 1; } for (int i=1; i < ua->argc; i++) { - for (node = tree->node->child; node; node=node->sibling) { + foreach_child(node, tree->node) { if (fnmatch(ua->argk[i], node->fname, 0) == 0) { if (node->type == TN_DIR || node->type == TN_DIR_NLS) { node->extract_dir = false; diff --git a/bacula/src/lib/bpipe.c b/bacula/src/lib/bpipe.c index 21f628350c..6955aa650e 100644 --- a/bacula/src/lib/bpipe.c +++ b/bacula/src/lib/bpipe.c @@ -202,6 +202,7 @@ int close_bpipe(BPIPE *bpipe) if (WIFEXITED(chldstatus)) { /* process exit()ed */ stat = WEXITSTATUS(chldstatus); if (stat != 0) { + Dmsg1(100, "Non-zero status %s returned from child.\n", stat); stat = ECHILD; } Dmsg1(200, "child status=%d\n", stat); diff --git a/bacula/src/lib/dlist.h b/bacula/src/lib/dlist.h index d6bd8e6590..7c591ef93b 100644 --- a/bacula/src/lib/dlist.h +++ b/bacula/src/lib/dlist.h @@ -42,7 +42,7 @@ #ifdef the_old_way #define foreach_dlist(var, list) \ - for((var)=NULL; (((void *)(var))=(list)->next(var)); ) + for((var)=NULL; (((void *)(var))=(list)->next(var)); ) #endif struct dlink { @@ -54,8 +54,8 @@ struct dlink { class dlist { void *head; void *tail; - int loffset; - int num_items; + uint16_t loffset; + uint32_t num_items; public: dlist(void *item, void *link); void init(void *item, void *link); @@ -66,7 +66,7 @@ public: void *dlist::binary_insert(void *item, int compare(void *item1, void *item2)); void remove(void *item); bool empty(); - int size(); + int size(); void *next(void *item); void *prev(void *item); void destroy(); @@ -76,7 +76,7 @@ public: void operator delete(void *); }; -/* +/* * This allows us to do explicit initialization, * allowing us to mix C++ classes inside malloc'ed * C structures. Define before called in constructor. diff --git a/bacula/src/lib/tree.c b/bacula/src/lib/tree.c index 381f4531f7..d4fb6402e5 100755 --- a/bacula/src/lib/tree.c +++ b/bacula/src/lib/tree.c @@ -28,17 +28,11 @@ #include "bacula.h" #include "findlib/find.h" -/* - * Define SORT_SIBLINGS you want the sibling list to - * be sorted otherwise it will be appended when - * a new entry is added. - */ -#define SORT_SIBLINGS - /* Forward referenced subroutines */ static TREE_NODE *search_and_insert_tree_node(char *fname, int type, TREE_NODE *node, TREE_ROOT *root, TREE_NODE *parent); +static char *tree_alloc(TREE_ROOT *root, int size); /* * NOTE !!!!! we turn off Debug messages for performance reasons. @@ -86,7 +80,6 @@ TREE_ROOT *new_tree(int count) } root = (TREE_ROOT *)malloc(sizeof(TREE_ROOT)); memset(root, 0, sizeof(TREE_ROOT)); - root->type = TN_ROOT; /* Assume filename + node = 40 characters average length */ size = count * (BALIGN(sizeof(TREE_NODE)) + 40); if (count > 1000000 || size > 10000000) { @@ -95,35 +88,25 @@ TREE_ROOT *new_tree(int count) Dmsg2(400, "count=%d size=%d\n", count, size); malloc_buf(root, size); root->cached_path = get_pool_memory(PM_FNAME); + root->type = TN_ROOT; + root->fname = ""; return root; } /* - * Create a new tree node. Size depends on type. + * Create a new tree node. */ -TREE_NODE *new_tree_node(TREE_ROOT *root, int type) +static TREE_NODE *new_tree_node(TREE_ROOT *root, int type) { TREE_NODE *node; - int asize = BALIGN(sizeof(TREE_NODE)); - - if (root->mem->rem < asize) { - uint32_t mb_size; - if (root->total_size >= 1000000) { - mb_size = 1000000; - } else { - mb_size = 100000; - } - malloc_buf(root, mb_size); - } - root->mem->rem -= asize; - node = (TREE_NODE *)root->mem->mem; - root->mem->mem += asize; - memset(node, 0, sizeof(TREE_NODE)); - node->type = type; + int size = sizeof(TREE_NODE); + node = (TREE_NODE *)tree_alloc(root, size); + memset(node, 0, size); return node; } + /* * Allocate bytes for filename in tree structure. * Keep the pointers properly aligned by allocating @@ -162,6 +145,7 @@ void free_tree(TREE_ROOT *root) } if (root->cached_path) { free_pool_memory(root->cached_path); + root->cached_path = NULL; } Dmsg2(400, "Total size=%u blocks=%d\n", root->total_size, root->blocks); free(root); @@ -169,21 +153,20 @@ void free_tree(TREE_ROOT *root) } - /* * Insert a node in the tree. This is the main subroutine * called when building a tree. * */ -TREE_NODE *insert_tree_node(char *path, TREE_NODE *node, +TREE_NODE *insert_tree_node(char *path, char *fname, TREE_NODE *node, TREE_ROOT *root, TREE_NODE *parent) { - char *p, *q, *fname; + char *p, *q; int path_len = strlen(path); Dmsg1(100, "insert_tree_node: %s\n", path); /* - * If trailing slash, strip it + * If trailing slash on path, strip it */ if (path_len > 0) { q = path + path_len - 1; @@ -195,11 +178,18 @@ TREE_NODE *insert_tree_node(char *path, TREE_NODE *node, } else { q = NULL; /* no trailing slash */ } - p = strrchr(path, '/'); /* separate path and filename */ - if (p) { - fname = p + 1; + /* If no filename, strip last component of path as "filename" */ + if (*fname == 0) { + p = strrchr(path, '/'); /* separate path and filename */ + if (p) { + fname = p + 1; /* set new filename */ + *p = 0; /* terminate new path */ + } + } else { + p = NULL; + } + if (*fname) { if (!parent) { /* if no parent, we need to make one */ - *p = 0; /* terminate path */ Dmsg1(100, "make_tree_path for %s\n", path); path_len = strlen(path); /* get new length */ if (path_len == root->cached_path_len && @@ -212,7 +202,6 @@ TREE_NODE *insert_tree_node(char *path, TREE_NODE *node, root->cached_parent = parent; } Dmsg1(100, "parent=%s\n", parent->fname); - *p = '/'; /* restore full path */ } } else { fname = path; @@ -227,6 +216,9 @@ TREE_NODE *insert_tree_node(char *path, TREE_NODE *node, if (q) { /* if trailing slash on entry */ *q = '/'; /* restore it */ } + if (p) { /* if slash in path trashed */ + *p = '/'; /* restore full path */ + } return node; } @@ -267,12 +259,11 @@ static TREE_NODE *search_and_insert_tree_node(char *fname, int type, TREE_NODE *node, TREE_ROOT *root, TREE_NODE *parent) { TREE_NODE *sibling, *last_sibling = NULL; -#ifdef SORT_SIBLINGS uint16_t fname_len = strlen(fname); int cmp; /* Is it already a sibling? */ - for (sibling=parent->child; sibling; sibling=sibling->sibling) { + foreach_child(sibling, parent) { Dmsg2(000, "sibling->fname=%s fname=%s\n", sibling->fname, fname); if (fname[0] > sibling->fname[0] || (cmp=strcmp(fname, sibling->fname)) > 0) { last_sibling = sibling; @@ -283,30 +274,17 @@ static TREE_NODE *search_and_insert_tree_node(char *fname, int type, if (!node) { node = new_tree_node(root, type); } - node->sibling = sibling; - if (sibling == parent->child) { /* if sibling was at head of list */ - parent->child = NULL; /* force parent to be updated below */ + node->sibling_ = sibling; + if (sibling == first_child(parent)) { /* if sibling was at head of list */ + parent->child_ = NULL; /* force parent to be updated below */ } Dmsg2(000, "insert before sibling->fname=%s fname=%s\n", sibling->fname, fname); break; } /* Found it */ + sibling->inserted = false; /* already in tree */ return sibling; } -#else - uint16_t fname_len = strlen(fname); - - /* Is it already a sibling? */ - for (sibling=parent->child; sibling; sibling=sibling->sibling) { - Dmsg2(100, "sibling->fname=%s fname=%s\n", sibling->fname, fname); - if (sibling->fname_len == fname_len && - strcmp(sibling->fname, fname) == 0) { - Dmsg1(100, "make_tree_path: found parent=%s\n", parent->fname); - return sibling; - } - last_sibling = sibling; - } -#endif /* @@ -320,10 +298,10 @@ static TREE_NODE *search_and_insert_tree_node(char *fname, int type, node->fname = tree_alloc(root, node->fname_len + 1); strcpy(node->fname, fname); node->parent = parent; - if (!parent->child) { - parent->child = node; + if (!tree_node_has_child(parent)) { + parent->child_ = node; } else { - last_sibling->sibling = node; + last_sibling->sibling_ = node; } /* Maintain a linear chain of nodes */ @@ -334,6 +312,7 @@ static TREE_NODE *search_and_insert_tree_node(char *fname, int type, root->last->next = node; root->last = node; } + node->inserted = true; /* inserted into tree */ return node; } @@ -373,7 +352,7 @@ int tree_getpath(TREE_NODE *node, char *buf, int buf_size) * i.e. it is linked to a directory. */ if ((node->type != TN_FILE && !(buf[0] == '/' && buf[1] == 0)) || - (node->soft_link && node->child)) { + (node->soft_link && tree_node_has_child(node))) { bstrncat(buf, "/", buf_size); } return 1; @@ -423,14 +402,14 @@ TREE_NODE *tree_relcwd(char *path, TREE_ROOT *root, TREE_NODE *node) len = strlen(path); } Dmsg2(100, "tree_relcwd: len=%d path=%s\n", len, path); - for (cd=node->child; cd; cd=cd->sibling) { + foreach_child(cd, node) { Dmsg1(100, "tree_relcwd: test cd=%s\n", cd->fname); if (cd->fname[0] == path[0] && len == (int)strlen(cd->fname) && strncmp(cd->fname, path, len) == 0) { break; } } - if (!cd || (cd->type == TN_FILE && !cd->child)) { + if (!cd || (cd->type == TN_FILE && !tree_node_has_child(cd))) { return NULL; } if (!p) { @@ -583,15 +562,15 @@ void print_tree(char *path, TREE_NODE *tree) case TN_DIR: case TN_DIR_NLS: bsnprintf(buf, sizeof(buf), "%s/%s", path, tree->fname); - print_tree(buf, tree->child); + print_tree(buf, first_child(tree)); break; case TN_ROOT: - print_tree(path, tree->child); + print_tree(path, first_child(tree)); break; default: Pmsg1(000, "Unknown node type %d\n", tree->type); } - print_tree(path, tree->sibling); + print_tree(path, tree->sibling_); return; } diff --git a/bacula/src/lib/tree.h b/bacula/src/lib/tree.h index 4176699871..dd81675648 100644 --- a/bacula/src/lib/tree.h +++ b/bacula/src/lib/tree.h @@ -25,70 +25,82 @@ */ struct s_mem { - struct s_mem *next; /* next buffer */ - int rem; /* remaining bytes */ - char *mem; /* memory pointer */ - char first[1]; /* first byte */ + struct s_mem *next; /* next buffer */ + int rem; /* remaining bytes */ + char *mem; /* memory pointer */ + char first[1]; /* first byte */ }; +#define foreach_child(cld, node) \ + for(cld=(node)->child_; cld; cld=cld->sibling_) + +#define tree_node_has_child(node) \ + ((node)->child_ != NULL) + +#define first_child(node) \ + ((node)->child_) + + /* * Keep this node as small as possible because * there is one for each file. */ struct s_tree_node { - char *fname; /* file name */ - int32_t FileIndex; /* file index */ - uint32_t JobId; /* JobId */ - uint16_t fname_len; /* filename length */ - int type: 8; /* node type */ - unsigned int extract: 1; /* extract item */ + char *fname; /* file name */ + int32_t FileIndex; /* file index */ + uint32_t JobId; /* JobId */ + uint16_t fname_len; /* filename length */ + int type: 8; /* node type */ + unsigned int extract: 1; /* extract item */ unsigned int extract_dir: 1; /* extract dir entry only */ - unsigned int hard_link: 1; /* set if have hard link */ - unsigned int soft_link: 1; /* set if is soft link */ + unsigned int hard_link: 1; /* set if have hard link */ + unsigned int soft_link: 1; /* set if is soft link */ + unsigned int inserted: 1; /* set when newly inserted */ struct s_tree_node *parent; - struct s_tree_node *sibling; - struct s_tree_node *child; - struct s_tree_node *next; /* next hash of FileIndex */ + struct s_tree_node *sibling_; + struct s_tree_node *next; /* next hash of FileIndex */ + struct s_tree_node *child_; }; typedef struct s_tree_node TREE_NODE; struct s_tree_root { - char *fname; /* file name */ - int32_t FileIndex; /* file index */ - uint32_t JobId; /* JobId */ - uint16_t fname_len; /* filename length */ - unsigned int type: 8; /* node type */ - unsigned int extract: 1; /* extract item */ + char *fname; /* file name */ + int32_t FileIndex; /* file index */ + uint32_t JobId; /* JobId */ + uint16_t fname_len; /* filename length */ + unsigned int type: 8; /* node type */ + unsigned int extract: 1; /* extract item */ unsigned int extract_dir: 1; /* extract dir entry only */ - unsigned int have_link: 1; /* set if have hard link */ + unsigned int have_link: 1; /* set if have hard link */ + unsigned int inserted: 1; /* set when newly inserted */ struct s_tree_node *parent; - struct s_tree_node *sibling; - struct s_tree_node *child; - struct s_tree_node *next; /* next hash of FileIndex */ + struct s_tree_node *sibling_; + struct s_tree_node *next; /* next hash of FileIndex */ + struct s_tree_node *child_; /* The above ^^^ must be identical to a TREE_NODE structure */ - struct s_tree_node *first; /* first entry in the tree */ - struct s_tree_node *last; /* last entry in tree */ - struct s_mem *mem; /* tree memory */ - uint32_t total_size; /* total bytes allocated */ - uint32_t blocks; /* total mallocs */ - int cached_path_len; /* length of cached path */ - char *cached_path; /* cached current path */ - TREE_NODE *cached_parent; /* cached parent for above path */ + struct s_tree_node *first; /* first entry in the tree */ + struct s_tree_node *last; /* last entry in tree */ + struct s_mem *mem; /* tree memory */ + uint32_t total_size; /* total bytes allocated */ + uint32_t blocks; /* total mallocs */ + int cached_path_len; /* length of cached path */ + char *cached_path; /* cached current path */ + TREE_NODE *cached_parent; /* cached parent for above path */ }; typedef struct s_tree_root TREE_ROOT; /* type values */ -#define TN_ROOT 1 /* root node */ -#define TN_NEWDIR 2 /* created directory to fill path */ -#define TN_DIR 3 /* directory entry */ -#define TN_DIR_NLS 4 /* directory -- no leading slash -- win32 */ -#define TN_FILE 5 /* file entry */ +#define TN_ROOT 1 /* root node */ +#define TN_NEWDIR 2 /* created directory to fill path */ +#define TN_DIR 3 /* directory entry */ +#define TN_DIR_NLS 4 /* directory -- no leading slash -- win32 */ +#define TN_FILE 5 /* file entry */ +/* External interface */ TREE_ROOT *new_tree(int count); -TREE_NODE *new_tree_node(TREE_ROOT *root, int type); -TREE_NODE *insert_tree_node(char *fname, TREE_NODE *node, - TREE_ROOT *root, TREE_NODE *parent); +TREE_NODE *insert_tree_node(char *path, char *fname, TREE_NODE *node, + TREE_ROOT *root, TREE_NODE *parent); TREE_NODE *make_tree_path(char *path, TREE_ROOT *root); TREE_NODE *tree_cwd(char *path, TREE_ROOT *root, TREE_NODE *node); TREE_NODE *tree_relcwd(char *path, TREE_ROOT *root, TREE_NODE *node); diff --git a/bacula/src/stored/Makefile.in b/bacula/src/stored/Makefile.in index a3192c7f23..de69c1cdcc 100644 --- a/bacula/src/stored/Makefile.in +++ b/bacula/src/stored/Makefile.in @@ -83,41 +83,41 @@ all: Makefile bacula-sd @STATIC_SD@ bls bextract bscan btape bcopy @echo " " bacula-sd: $(SVROBJS) ../lib/libbac.a - $(CXX) $(WLDFLAGS) $(LDFLAGS) -L../lib -o $@ $(SVROBJS) $(FDLIBS) -lbac -lm $(LIBS) $(DLIB) + $(CXX) $(WLDFLAGS) $(LDFLAGS) -L../lib -o $@ $(SVROBJS) $(FDLIBS) -lbac -lm $(DLIB) $(LIBS) static-bacula-sd: $(SVROBJS) ../lib/libbac.a - $(CXX) $(WLDFLAGS) $(LDFLAGS) -static -L../lib -o $@ $(SVROBJS) $(FDLIBS) -lbac -lm $(LIBS) $(DLIB) + $(CXX) $(WLDFLAGS) $(LDFLAGS) -static -L../lib -o $@ $(SVROBJS) $(FDLIBS) -lbac -lm $(DLIB) $(LIBS) strip $@ btape.o: btape.c $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $< btape: $(TAPEOBJS) ../lib/libbac.a ../cats/libsql.a - $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L../lib -L../cats -o $@ $(TAPEOBJS) -lsql $(LIBS) $(DLIB) -lbac -lm + $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L../lib -L../cats -o $@ $(TAPEOBJS) -lsql $(DLIB) -lbac -lm $(LIBS) bls.o: bls.c $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $< bls: ../findlib/libfind.a $(BLSOBJS) ../lib/libbac.a - $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L../lib -L../findlib -o $@ $(BLSOBJS) $(LIBS) $(DLIB) -lfind -lbac -lm + $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L../lib -L../findlib -o $@ $(BLSOBJS) $(DLIB) -lfind -lbac -lm $(LIBS) bextract.o: bextract.c $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $< bextract: ../findlib/libfind.a $(BEXTOBJS) ../lib/libbac.a - $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L../lib -L../findlib -o $@ $(BEXTOBJS) $(LIBS) $(DLIB) $(FDLIBS) -lfind -lbac -lm + $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L../lib -L../findlib -o $@ $(BEXTOBJS) $(DLIB) $(FDLIBS) -lfind -lbac -lm $(LIBS) bscan.o: bscan.c $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $< bscan: ../findlib/libfind.a $(SCNOBJS) ../cats/libsql.a - $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L../lib -L../cats -L../findlib -o $@ $(SCNOBJS) -lsql $(LIBS) $(DB_LIBS) $(FDLIBS) -lfind -lbac -lm + $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L../lib -L../cats -L../findlib -o $@ $(SCNOBJS) -lsql $(DB_LIBS) $(FDLIBS) -lfind -lbac -lm $(LIBS) bcopy.o: bcopy.c $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $< bcopy: $(COPYOBJS) ../findlib/libfind.a ../lib/libbac.a - $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L../lib -L../findlib -o $@ $(COPYOBJS) $(LIBS) $(DB_LIBS) $(FDLIBS) -lfind -lbac -lm + $(CXX) $(TTOOL_LDFLAGS) $(LDFLAGS) -L../lib -L../findlib -o $@ $(COPYOBJS) $(DB_LIBS) $(FDLIBS) -lfind -lbac -lm $(LIBS) Makefile: $(srcdir)/Makefile.in $(topdir)/config.status diff --git a/bacula/src/stored/autochanger.c b/bacula/src/stored/autochanger.c index 67cca5bad6..d459689e32 100644 --- a/bacula/src/stored/autochanger.c +++ b/bacula/src/stored/autochanger.c @@ -72,16 +72,13 @@ int autoload_device(JCR *jcr, DEVICE *dev, int writing, BSOCK *dir) if (slot > 0 && jcr->device->changer_name && jcr->device->changer_command) { uint32_t timeout = jcr->device->max_changer_wait; - POOLMEM *changer, *results; + POOLMEM *changer; int loaded, status; - results = get_pool_memory(PM_MESSAGE); changer = get_pool_memory(PM_FNAME); loaded = get_autochanger_loaded_slot(jcr); - Dmsg1(400, "loaded=%s\n", results); - /* If tape we want is not loaded, load it. */ if (loaded != slot) { offline_or_rewind_dev(dev); @@ -121,7 +118,6 @@ int autoload_device(JCR *jcr, DEVICE *dev, int writing, BSOCK *dir) status = 0; /* we got what we want */ } free_pool_memory(changer); - free_pool_memory(results); Dmsg1(400, "After changer, status=%d\n", status); if (status == 0) { /* did we succeed? */ rtn_stat = 1; /* tape loaded by changer */ diff --git a/bacula/src/stored/block.c b/bacula/src/stored/block.c index 2f23ffee52..832da0ee25 100644 --- a/bacula/src/stored/block.c +++ b/bacula/src/stored/block.c @@ -523,7 +523,7 @@ int write_block_to_dev(DCR *dcr, DEV_BLOCK *block) } dev->VolCatInfo.VolCatWrites++; - Dmsg1(300, "Write block of %u bytes\n", wlen); + Dmsg1(200, "Write block of %u bytes\n", wlen); stat = write(dev->fd, block->buf, (size_t)wlen); if (stat != (ssize_t)wlen) { /* We should check for errno == ENOSPC, BUT many @@ -545,7 +545,7 @@ int write_block_to_dev(DCR *dcr, DEV_BLOCK *block) if (dev->dev_errno == 0) { dev->dev_errno = ENOSPC; /* out of space */ } - Jmsg(jcr, M_ERROR, 0, _("Write error at %u:%u on device %s. ERR=%s.\n"), + Jmsg4(jcr, M_ERROR, 0, _("Write error at %u:%u on device %s. ERR=%s.\n"), dev->file, dev->block_num, dev->dev_name, strerror(dev->dev_errno)); } else { dev->dev_errno = ENOSPC; /* out of space */ diff --git a/bacula/src/tools/Makefile.in b/bacula/src/tools/Makefile.in index 739c71f43c..41bebb8eca 100644 --- a/bacula/src/tools/Makefile.in +++ b/bacula/src/tools/Makefile.in @@ -43,18 +43,18 @@ all: Makefile bsmtp dbcheck testfind testls @echo " " bsmtp: bsmtp.o ../lib/libbac.a - $(CXX) $(LDFLAGS) -L../lib -o $@ bsmtp.o -lbac -lm $(LIBS) $(DLIB) + $(CXX) $(LDFLAGS) -L../lib -o $@ bsmtp.o -lbac -lm $(DLIB) $(LIBS) dbcheck: dbcheck.o ../lib/libbac.a ../cats/libsql.a $(DIRCONFOBJS) - $(CXX) $(LDFLAGS) -L../lib -L../cats -o $@ dbcheck.o $(DIRCONFOBJS) -lsql -lbac -lm $(LIBS) $(DB_LIBS) + $(CXX) $(LDFLAGS) -L../lib -L../cats -o $@ dbcheck.o $(DIRCONFOBJS) -lsql -lbac -lm $(DB_LIBS) $(LIBS) testfind: ../findlib/libfind.a ../lib/libbac.a $(FINDOBJS) $(CXX) -g $(LDFLAGS) -L. -L../lib -L../findlib -o $@ $(FINDOBJS) \ - $(LIBS) $(DLIB) -lfind -lbac -lm + $(DLIB) -lfind -lbac -lm $(LIBS) testls: ../findlib/libfind.a ../lib/libbac.a testls.o $(CXX) -g $(LDFLAGS) -L. -L../lib -L../findlib -o $@ testls.o \ - $(LIBS) $(DLIB) -lfind -lbac -lm + $(DLIB) -lfind -lbac -lm $(LIBS) Makefile: $(srcdir)/Makefile.in $(topdir)/config.status cd $(topdir) \ diff --git a/bacula/src/version.h b/bacula/src/version.h index ea7ebab74f..074b9a0eb6 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -2,8 +2,8 @@ #undef VERSION #define VERSION "1.35.0" #define VSTRING "1" -#define BDATE "15 June 2004" -#define LSMDATE "15Jun04" +#define BDATE "16 June 2004" +#define LSMDATE "16Jun04" /* Debug flags */ #undef DEBUG