unbash_spaces(devname);
foreach_res(device, R_DEVICE) {
/* Find resource, and make sure we were able to open it */
- if (fnmatch(device->hdr.name, devname.c_str(), 0) == 0) {
+ if (strcmp(device->hdr.name, devname.c_str()) == 0) {
if (!device->dev) {
device->dev = init_dev(jcr, device);
}
if (!found) {
foreach_res(changer, R_AUTOCHANGER) {
/* Find resource, and make sure we were able to open it */
- if (fnmatch(devname.c_str(), changer->hdr.name, 0) == 0) {
+ if (strcmp(devname.c_str(), changer->hdr.name) == 0) {
/* Try each device in this AutoChanger */
foreach_alist(device, changer->device) {
Dmsg1(100, "Try changer device %s\n", device->hdr.name);
"If this is not a blank tape, try unmounting and remounting the Volume.\n"),
dev->print_name());
}
- } else if (dev->is_dvd()) {
+ } else if (dev->is_unmountable()) {
if (dev->mount(1)) {
bnet_fsend(dir, _("3002 Device %s is mounted.\n"),
dev->print_name());
if (!dev->is_busy()) {
unload_autochanger(dcr, -1);
}
- if (dev->is_dvd()) {
+ if (dev->is_unmountable()) {
if (dev->unmount(0)) {
bnet_fsend(dir, _("3002 Device %s unmounted.\n"),
dev->print_name());
/* ***FIXME**** what is this ???? */
dev->close();
}
- if (dev->is_dvd() && !dev->unmount(0)) {
+ if (dev->is_unmountable() && !dev->unmount(0)) {
bnet_fsend(dir, _("3907 %s"), dev->bstrerror());
} else {
dev->set_blocked(BST_UNMOUNTED_WAITING_FOR_SYSOP);
if (!unload_autochanger(dcr, -1)) {
dev->close();
}
- if (dev->is_dvd() && !dev->unmount(0)) {
+ if (dev->is_unmountable() && !dev->unmount(0)) {
bnet_fsend(dir, _("3907 %s"), dev->bstrerror());
} else {
bnet_fsend(dir, _("3002 Device %s unmounted.\n"),