]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix some bugs in SD with multiple files
authorKern Sibbald <kern@sibbald.com>
Sat, 26 Feb 2005 16:01:45 +0000 (16:01 +0000)
committerKern Sibbald <kern@sibbald.com>
Sat, 26 Feb 2005 16:01:45 +0000 (16:01 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1846 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/stored/acquire.c
bacula/src/stored/status.c

index 88e88c3e83abf2d64455da292bb345d3e4468902..71c9811a3a374b99f9cb59a75b5184940b2c5b0a 100644 (file)
@@ -527,7 +527,8 @@ bool release_device(JCR *jcr)
 
    if (dev->can_read()) {
       dev->clear_read();             /* clear read bit */
-      if (!dev_is_tape(dev) || !dev_cap(dev, CAP_ALWAYSOPEN)) {
+      /* Close if file or !CAP_ALWAYSOPEN */
+      if (!dev->is_tape() || !dev_cap(dev, CAP_ALWAYSOPEN)) {
         offline_or_rewind_dev(dev);
         close_dev(dev);
       }
@@ -553,7 +554,8 @@ bool release_device(JCR *jcr)
         dir_update_volume_info(dcr, false); /* send Volume info to Director */
       }
 
-      if (dev->num_writers == 0 && dev->is_tape() && !dev_cap(dev, CAP_ALWAYSOPEN)) {
+      /* If no writers, close if file or !CAP_ALWAYS_OPEN */
+      if (dev->num_writers == 0 && (!dev->is_tape() || !dev_cap(dev, CAP_ALWAYSOPEN))) {
         offline_or_rewind_dev(dev);
         close_dev(dev);
       }
index 7ebbd19666295323d6ba459979c4e4cae779f51a..1430d82830e891211b96e196a8e1dbe11113a694 100644 (file)
@@ -176,7 +176,7 @@ static void send_blocked_status(JCR *jcr, DEVICE *dev)
          bnet_fsend(user, _("    Device is BLOCKED waiting for mount of volume \"%s\".\n"),
            dcr->VolumeName);
       } else {
-         bnet_fsend(user, _("    Device is BLOCKED waiting for appendable media.\n"));
+         bnet_fsend(user, _("    Device is BLOCKED waiting for media.\n"));
       }
       break;
    case BST_DOING_ACQUIRE:
@@ -218,6 +218,8 @@ static void send_blocked_status(JCR *jcr, DEVICE *dev)
       bnet_fsend(user, "%sSHORT ", dev->state & ST_SHORT ? "" : "!");
       bnet_fsend(user, "%sMOUNTED ", dev->state & ST_MOUNTED ? "" : "!");
       bnet_fsend(user, "\n");
+      bnet_fsend(user, "num_writers=%d JobStatus=%c block=%d\nn", dev->num_writers,
+        jcr->JobStatus, dev->dev_blocked);
 
       bnet_fsend(user, _("Device parameters:\n"));
       bnet_fsend(user, "Archive name: %s Device name: %s\n", dev->dev_name,