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);
}
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);
}
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:
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,