Changes to 1.37.37:
24Aug05
+- Ensure that the drive is closed before calling the
+ mtx-changer script so that the script can access the drive.
- Add drive name to reserved Volume list printout in SD.
23Aug05
- Fix bug in acquire.c that incorrectly reported volume
goto bail_out;
}
+ /* We are going to load a new tape, so close the device */
+ offline_or_rewind_dev(dev);
+ force_close_device(dev);
+
/*
* Load the desired cassette
*/
return false;
}
- offline_or_rewind_dev(dev);
/* We are going to load a new tape, so close the device */
+ offline_or_rewind_dev(dev);
force_close_device(dev);
if (loaded < 0) {
if (changer->device->size() == 1) {
return true;
}
-
+
foreach_alist(device, changer->device) {
if (device->dev && device->dev->Slot == slot) {
found = true;
return false;
}
+ /* We are going to unload a tape, so close the device */
offline_or_rewind_dev(dev);
- /* We are going to load a new tape, so close the device */
force_close_device(dev);
POOLMEM *changer_cmd = get_pool_memory(PM_FNAME);
{
struct mtop mt_com;
- if (dev->fd < 0) {
- dev->dev_errno = EBADF;
- Mmsg0(dev->errmsg, _("Bad call to offline_dev. Device not open\n"));
- Emsg0(M_FATAL, 0, dev->errmsg);
- return false;
- }
- if (!(dev->is_tape())) {
- return true;
+ if (!dev || dev->fd < 0 || !dev->is_tape()) {
+ return true; /* device not open */
}
dev->state &= ~(ST_APPEND|ST_READ|ST_EOT|ST_EOF|ST_WEOT); /* remove EOF/EOT flags */
*/
void force_close_device(DEVICE *dev)
{
- if (!dev) {
- Mmsg0(dev->errmsg, _("Bad call to force_close_dev. Device not open\n"));
- Emsg0(M_FATAL, 0, dev->errmsg);
+ if (!dev || dev->fd < 0) {
return;
}
Dmsg1(29, "Force close_dev %s\n", dev->print_name());