void unreserve_device(DCR *dcr)
{
DEVICE *dev = dcr->dev;
- dev->dlock();
if (dcr->reserved_device) {
dcr->reserved_device = false;
dev->reserved_device--;
}
volume_unused(dcr);
- dev->dunlock();
}
/*
AUTOCHANGER *changer = vol->dev->device->changer_res;
/* Find resource, and make sure we were able to open it */
- if (fnmatch(rctx.device_name, changer->hdr.name, 0) == 0) {
+ if (strcmp(rctx.device_name, changer->hdr.name) == 0) {
Dmsg2(dbglvl, "jid=%u Found changer device %s\n",
(int)rctx.jcr->JobId, vol->dev->device->hdr.name);
return true;
foreach_res(changer, R_AUTOCHANGER) {
Dmsg2(dbglvl, "jid=%u Try match changer res=%s\n", (int)rctx.jcr->JobId, changer->hdr.name);
/* Find resource, and make sure we were able to open it */
- if (fnmatch(rctx.device_name, changer->hdr.name, 0) == 0) {
+ if (strcmp(rctx.device_name, changer->hdr.name) == 0) {
/* Try each device in this AutoChanger */
foreach_alist(rctx.device, changer->device) {
Dmsg2(dbglvl, "jid=%u Try changer device %s\n", (int)rctx.jcr->JobId,
foreach_res(rctx.device, R_DEVICE) {
Dmsg2(dbglvl, "jid=%u Try match res=%s\n", (int)rctx.jcr->JobId, rctx.device->hdr.name);
/* Find resource, and make sure we were able to open it */
- if (fnmatch(rctx.device_name, rctx.device->hdr.name, 0) == 0) {
+ if (strcmp(rctx.device_name, rctx.device->hdr.name) == 0) {
stat = reserve_device(rctx);
if (stat != 1) { /* try another device */
continue;