* expires.
*/
P(mutex);
- for ( ;!job_canceled(jcr); ) {
+ for ( ; !job_canceled(jcr); ) {
errstat = pthread_cond_timedwait(&jcr->job_start_wait, &mutex, &timeout);
if (errstat == 0 || errstat == ETIMEDOUT) {
break;
unbash_spaces(dev_name);
foreach_res(device, R_DEVICE) {
/* Find resource, and make sure we were able to open it */
- if (fnmatch(dev_name.c_str(), device->hdr.name, 0) == 0) {
+ if (strcmp(dev_name.c_str(), device->hdr.name) == 0) {
if (!device->dev) {
device->dev = init_dev(jcr, device);
}
}
foreach_res(changer, R_AUTOCHANGER) {
/* Find resource, and make sure we were able to open it */
- if (fnmatch(dev_name.c_str(), changer->hdr.name, 0) == 0) {
+ if (strcmp(dev_name.c_str(), changer->hdr.name) == 0) {
if (!changer->device || changer->device->size() == 0) {
continue; /* no devices */
}
}
jcr->dcrs = NULL;
+ /* Avoid a double free */
+ if (jcr->dcr == jcr->read_dcr) {
+ jcr->read_dcr = NULL;
+ }
if (jcr->dcr) {
free_dcr(jcr->dcr);
jcr->dcr = NULL;