DEVICE *setup_to_access_device(JCR *jcr, int read_access)
{
DEVICE *dev;
- DEV_BLOCK *block;
char *p;
DEVRES *device;
}
Dmsg0(90, "Device opened for read.\n");
- block = new_block(dev);
-
create_vol_list(jcr);
if (read_access) {
- if (!acquire_device_for_read(jcr, dev, block)) {
- free_block(block);
+ if (!acquire_device_for_read(jcr)) {
return NULL;
}
}
- free_block(block);
return dev;
}
if (jcr->VolList) {
free_vol_list(jcr);
}
+ if (jcr->dcr) {
+ free_dcr(jcr->dcr);
+ jcr->dcr = NULL;
+ }
return;
}